From 4ba45ec3fc6d94657e23cecaca27bf4dc5c7c0a5 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 2 May 2006 21:15:39 +0000 Subject: add --- t/basename.t | 12 ++++++++++++ t/dirname.t | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 t/basename.t create mode 100755 t/dirname.t (limited to 't') diff --git a/t/basename.t b/t/basename.t new file mode 100755 index 000000000..87ae42cf3 --- /dev/null +++ b/t/basename.t @@ -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 index 000000000..197d00d63 --- /dev/null +++ b/t/dirname.t @@ -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/"); -- cgit v1.2.3