t/000-module.t
changeset 1 9416fc33d2a0
parent 0 21a87c5f86e4
child 2 1bd03bcf26b4
--- a/t/000-module.t	Tue Aug 02 00:21:00 2011 +0200
+++ b/t/000-module.t	Tue Aug 02 16:02:54 2011 +0200
@@ -12,6 +12,25 @@
 foreach (qw(type pwd cd)) {
     can_ok $fops => $_;
 }
+is($fops->pwd() => "/", "working dir is /");
+
+my @dir = (
+    "////" => "/",
+    "/.//./" => "/",
+    "/.//./." => "/",
+    "././/./." => "/",
+    "/a/b/c/d/" => "/a/b/c/d",
+    "/a/b/c/d" => "/a/b/c/d",
+    ".."       => "/a/b/c",
+);
+
+while (@dir) {
+    my $dir = shift @dir;
+    my $pwd = shift @dir;
+
+    ok($fops->cd($dir), "cd $dir");
+    is($fops->pwd(), $pwd, "pwd should be $pwd");
+}
 
 
 done_testing;