X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/9ff9088636f6d065ac834a25a535e3dc86fde891..b5a05dbc33a1a24a6a20701d2756a2d4f4a77995:/t/meta.t
diff --git a/t/meta.t b/t/meta.t
index 63c01937f..7f26a957b 100755
--- a/t/meta.t
+++ b/t/meta.t
@@ -28,11 +28,11 @@ push @command, $srcdir, $destdir;
sub write_build_read_compare {
my ($pagename, $input, $expected_output) = @_;
+ ok(! system("rm -rf $tmp"), q{setup});
ok(! system("mkdir -p $srcdir"), q{setup});
writefile("$pagename.mdwn", $srcdir, $input);
ok(! system(@command), q{build});
like(readfile("$destdir/$pagename/index.html"), $expected_output);
- ok(! system("rm -rf $tmp"), q{teardown});
}
write_build_read_compare(
@@ -85,14 +85,14 @@ write_build_read_compare(
write_build_read_compare(
'date',
- q{[[!meta date="12345"]]},
- qr{},
+ q{[[!meta date="2000-01-23"]]},
+ qr{},
);
write_build_read_compare(
'updated',
- q{[[!meta updated="12345"]]},
- qr{},
+ q{[[!meta updated="2018-03-21"]]},
+ qr{},
);
#write_build_read_compare(
@@ -161,4 +161,16 @@ write_build_read_compare(
qr{},
);
+write_build_read_compare(
+ 'malformed_ISO-8601',
+ '[[!meta date="2018-02-281T12:00:00-0500"]]',
+ qr{Error: cannot parse date/time: 2018-02-281T12:00:00-0500},
+);
+
+write_build_read_compare(
+ 'nonsense_month',
+ '[[!meta date="2018-14-22T14:22:45-0500"]]',
+ qr{Error: cannot parse date/time: 2018-14-22T14:22:45-0500},
+);
+
done_testing();