feat: add unit tests
This commit is contained in:
30
t/10-html-escape.t
Executable file
30
t/10-html-escape.t
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 4;
|
||||
use MarkdownParser;
|
||||
|
||||
my $parser = MarkdownParser->new();
|
||||
|
||||
is(
|
||||
$parser->parse("Text with <tag>"),
|
||||
"<p>Text with <tag></p>\n",
|
||||
"HTML tags escaped"
|
||||
);
|
||||
is(
|
||||
$parser->parse("Text with & symbol"),
|
||||
"<p>Text with & symbol</p>\n",
|
||||
"Ampersand escaped"
|
||||
);
|
||||
is(
|
||||
$parser->parse('Text with "quotes"'),
|
||||
"<p>Text with "quotes"</p>\n",
|
||||
"Quotes escaped"
|
||||
);
|
||||
is(
|
||||
$parser->parse("Text with 'apostrophe'"),
|
||||
"<p>Text with 'apostrophe'</p>\n",
|
||||
"Apostrophe escaped"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user