[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 15:09:39 UTC 2010


The following commit has been merged in the master branch:
commit 65fa2451ea415d7621cf4ba02c2b7baed53b584a
Author: John Goerzen <jgoerzen at complete.org>
Date:   Mon Apr 10 22:05:52 2006 +0100

    New glob tests -- 709 unit tests now pass

diff --git a/testsrc/Globtest.hs b/testsrc/Globtest.hs
index 15f34c9..9163993 100644
--- a/testsrc/Globtest.hs
+++ b/testsrc/Globtest.hs
@@ -54,13 +54,30 @@ preppath x = bp ++ "/" ++ x
 
 test_literal =
     map f
-            [glob (preppath "a") >>= eq "" [(preppath "a")]
-            ,glob (preppath "a/D") >>= eq "" [(preppath "a/D")]
-            ,glob (preppath "aab") >>= eq "" [(preppath "aab")]
+            [glob (preppath "a") >>= eq "" [preppath "a"]
+            ,glob (preppath "a/D") >>= eq "" [preppath "a/D"]
+            ,glob (preppath "aab") >>= eq "" [preppath "aab"]
             ,glob (preppath "nonexistant") >>= eq "empty" []
             ]
 
-tests = TestList [TestLabel "test_literal" (TestList test_literal)]
+test_one_dir =
+    map f
+        [glob (preppath "a*") >>= eq "a*" (map preppath ["a", "aab", "aaa"]),
+         glob (preppath "*a") >>= eq "*a" (map preppath ["a", "aaa"]),
+         glob (preppath "aa?") >>= eq "aa?" (map preppath ["aaa", "aab"]),
+         glob (preppath "aa[ab]") >>= eq "aa[ab]" (map preppath ["aaa", "aab"]),
+         glob (preppath "*q") >>= eq "*q" []
+        ]
+
+test_nested_dir =
+    map f
+        [glob (preppath "a/bcd/E*") >>= eq "a/bcd/E*" [preppath "a/bcd/EF"],
+         glob (preppath "a/bcd/*g") >>= eq "a/bcd/*g" [preppath "a/bcd/efg"]
+        ]
+
+tests = TestList [TestLabel "test_literal" (TestList test_literal),
+                  TestLabel "test_one_dir" (TestList test_one_dir),
+                  TestLabel "test_nested_dir" (TestList test_nested_dir)]
 
 
 

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list