~ubuntu-branches/ubuntu/trusty/libtext-markdown-perl/trusty

« back to all changes in this revision

Viewing changes to t/10use_metadata.t

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Yu, Jonathan Yu, gregor herrmann, Nathan Handler
  • Date: 2009-08-26 11:14:08 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090826111408-p5lw469iekiybf4t
Tags: 1.0.25-1
[ Jonathan Yu ]
* New upstream release
  + MultiMarkdown is now removed from upstream package; it is now
    available as a separate standalone package
* Updated copyright information
* Added myself to Uploaders and Copyright
* Updated rules to new short format
* Updated control file description
* Standards-Version 3.8.3 (remove version dependency on perl)
* Install Markdown.pl as markdown, as before, but use overrides
* Add header for pod_name patch
* Remove .manpages file, they are installed automatically
* Suggest libtext-multimarkdown-perl (since it's a separate package now)
* Add libhtml-tidy-perl to B-D-I for testing
* Add a NEWS item for the libtext-multimarkdown-perl split

[ gregor herrmann ]
* debian/control: Added: ${misc:Depends} to Depends: field.

[ Nathan Handler ]
* debian/watch: Update to ignore development releases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
use strict;
2
 
use warnings;
3
 
use Test::More tests => 7;
4
 
 
5
 
#1
6
 
use_ok( 'Text::MultiMarkdown');
7
 
 
8
 
my $instr = qq{use wikilinks: on\nbase url: http://www.test.com/\n\nA trivial block of text with a WikiWord};
9
 
 
10
 
my $m = Text::MultiMarkdown->new(
11
 
    use_metadata => 1,
12
 
);
13
 
my $expstr = qq{base url: http://www.test.com/<br />\nuse wikilinks: on<br />\n
14
 
<p>A trivial block of text with a <a href="http://www.test.com/WikiWord">WikiWord</a></p>\n};
15
 
is( #2
16
 
    $m->markdown($instr) => $expstr, 
17
 
    'Markdown with wiki links, and base url, metadata switched on in instance'
18
 
);
19
 
 
20
 
$m = Text::MultiMarkdown->new(
21
 
    use_metadata => 0,
22
 
);
23
 
my $expstr2 = qq{<p>use wikilinks: on\nbase url: http://www.test.com/</p>\n\n<p>A trivial block of text with a WikiWord</p>\n};
24
 
is( #3
25
 
    $m->markdown($instr) => $expstr2, 
26
 
    'Markdown with wiki links, with base url in instance (no metadata)'
27
 
);
28
 
is( #4
29
 
    $m->markdown($instr, { use_metadata => 1 }) => $expstr, 
30
 
    'Markdown with wiki links, and base url, metadata switched on in options'
31
 
);
32
 
is( #5
33
 
    $m->markdown($instr) => $expstr2, 
34
 
    'Markdown with wiki links, with base url in instance (no metadata) - try 2 to ensure option to markdown does not frob setting'
35
 
);
36
 
 
37
 
$m = Text::MultiMarkdown->new(
38
 
    use_metadata   => 0,
39
 
    strip_metadata => 1,  
40
 
);
41
 
$expstr = qq{<p>A trivial block of text with a WikiWord</p>\n};
42
 
is( #6
43
 
    $m->markdown($instr) => $expstr, 
44
 
    'Markdown with wiki links, with metadata off and stripped'
45
 
);
46
 
 
47
 
$expstr = qq{<p>A trivial block of text with a <a href="http://www.test.com/WikiWord">WikiWord</a></p>\n};
48
 
is( #7
49
 
    $m->markdown($instr, { use_metadata => 1 }) => $expstr, 
50
 
    'Markdown with wiki links, with metadata on but stripped'
51
 
);