Skip to content
Permalink
Browse files

refactor test code

  • Loading branch information
szabgab committed Mar 5, 2018
1 parent c580d63 commit 79d9bfe516ab143b5dc7b81e263f62e529c8c1da
Showing with 7 additions and 6 deletions.
  1. +7 −6 t/01-test.t
@@ -6,14 +6,15 @@ use JSON::MaybeXS qw(decode_json);
use Path::Tiny qw(path);
use Markua::Parser;

plan tests => 3;
my @cases = ('heading1', 'headers');

plan tests => 1 + scalar @cases;

my $m = Markua::Parser->new;
isa_ok $m, 'Markua::Parser';

my $result = $m->parse_file('t/input/heading1.md');
is_deeply $result, decode_json( path('t/dom/heading1.json')->slurp_utf8 );

$result = $m->parse_file('t/input/headers.md');
is_deeply $result, decode_json( path('t/dom/headers.json')->slurp_utf8 );
for my $case (@cases) {
my $result = $m->parse_file("t/input/$case.md");
is_deeply $result, decode_json( path("t/dom/$case.json")->slurp_utf8 );
}

0 comments on commit 79d9bfe

Please sign in to comment.
You can’t perform that action at this time.