add
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 2 May 2006 21:15:39 +0000 (21:15 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 2 May 2006 21:15:39 +0000 (21:15 +0000)
t/basename.t [new file with mode: 0755]
t/dirname.t [new file with mode: 0755]

diff --git a/t/basename.t b/t/basename.t
new file mode 100755 (executable)
index 0000000..87ae42c
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Test::More tests => 6;
+
+BEGIN { use_ok("IkiWiki"); }
+
+is(IkiWiki::basename("/home/joey/foo/bar"), "bar");
+is(IkiWiki::basename("./foo"), "foo");
+is(IkiWiki::basename("baz"), "baz");
+is(IkiWiki::basename("/tmp/"), "");
+is(IkiWiki::basename("/home/joey/foo/"), "");
diff --git a/t/dirname.t b/t/dirname.t
new file mode 100755 (executable)
index 0000000..197d00d
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Test::More tests => 6;
+
+BEGIN { use_ok("IkiWiki"); }
+
+is(IkiWiki::dirname("/home/joey/foo/bar"), "/home/joey/foo");
+is(IkiWiki::dirname("./foo"), ".");
+is(IkiWiki::dirname("baz"), "");
+is(IkiWiki::dirname("/tmp/"), "/tmp/");
+is(IkiWiki::dirname("/home/joey/foo/"), "/home/joey/foo/");