feat: add unit tests

This commit is contained in:
2025-11-12 19:28:48 +01:00
parent 0eca6d6725
commit 6e9ce92cde
12 changed files with 510 additions and 0 deletions

25
t/02-paragraphs.t Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More tests => 3;
use MarkdownParser;
my $parser = MarkdownParser->new();
is(
$parser->parse("Simple paragraph"),
"<p>Simple paragraph</p>\n",
"Single paragraph"
);
is(
$parser->parse("First paragraph\n\nSecond paragraph"),
"<p>First paragraph</p>\n<p>Second paragraph</p>\n",
"Multiple paragraphs"
);
is(
$parser->parse("Paragraph with\nmultiple lines"),
"<p>Paragraph with multiple lines</p>\n",
"Multi-line paragraph"
);