File: external_links.t

package info (click to toggle)
libwiki-toolkit-formatter-usemod-perl 0.25-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 176 kB
  • sloc: perl: 258; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use Wiki::Toolkit::Formatter::UseMod;
use Test::More tests => 2;

my $wikitext = <<WIKITEXT;

http://external.example.com/

[http://external2.example.com/ foo]

WIKITEXT

my $formatter = Wiki::Toolkit::Formatter::UseMod->new(
                                          external_link_class => "external" );

my $html = $formatter->format( $wikitext );

like( $html,
      qr'<a href="http://external.example.com/" class="external">http://external.example.com/</a>',
      "external links with no title appear as expected" );

like( $html,
      qr'<a href="http://external2.example.com/" class="external">foo</a>',
      "external links with title appear as expected" );