From c439d5a8abcbdac5e00e32362413cbe29c2d8f0e Mon Sep 17 00:00:00 2001 From: joey Date: Mon, 11 Sep 2006 03:52:55 +0000 Subject: add --- t/pagename.t | 14 ++++++++++++++ t/pagetype.mdwn | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 t/pagename.t create mode 100755 t/pagetype.mdwn diff --git a/t/pagename.t b/t/pagename.t new file mode 100755 index 000000000..96e6a87f1 --- /dev/null +++ b/t/pagename.t @@ -0,0 +1,14 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Test::More tests => 5; + +BEGIN { use_ok("IkiWiki"); } + +# Used internally. +$IkiWiki::hooks{htmlize}{mdwn}=1; + +is(pagename("foo.mdwn"), "foo"); +is(pagename("foo/bar.mdwn"), "foo/bar"); +is(pagename("foo.png"), "foo.png"); +is(pagename("foo"), "foo"); diff --git a/t/pagetype.mdwn b/t/pagetype.mdwn new file mode 100755 index 000000000..76cacd8f7 --- /dev/null +++ b/t/pagetype.mdwn @@ -0,0 +1,14 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Test::More tests => 5; + +BEGIN { use_ok("IkiWiki"); } + +# Used internally. +$IkiWiki::hooks{htmlize}{mdwn}=1; + +is(pagetype("foo.mdwn"), "mdwn"); +is(pagetype("foo/bar.mdwn"), "mdwn"); +is(pagename("foo.png"), undef); +is(pagename("foo"), undef); -- cgit v1.2.3