[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:21:14 UTC 2010


The following commit has been merged in the master branch:
commit 0059059557d1059f6183c6f9d0b84190f875f792
Author: John Goerzen <jgoerzen at complete.org>
Date:   Fri Mar 9 00:47:29 2007 +0100

    Added new wildmatch and glob tests

diff --git a/src/System/Path/WildMatch.hs b/src/System/Path/WildMatch.hs
index 85cd3c5..7e5e5c9 100644
--- a/src/System/Path/WildMatch.hs
+++ b/src/System/Path/WildMatch.hs
@@ -95,6 +95,7 @@ convwild ('*':xs) = ".*" ++ convwild xs
 convwild ('?':xs) = "." ++ convwild xs
 convwild ('[':'!':xs) = "[^" ++ convpat xs
 convwild ('[':xs) = '[' : convpat xs
+convwild ('.':xs) = "\\." ++ convwild xs
 convwild (x:xs) = escapeRe [x] ++ convwild xs
 
 convpat :: String -> String
diff --git a/testsrc/Globtest.hs b/testsrc/Globtest.hs
index f807a66..7ab5f84 100644
--- a/testsrc/Globtest.hs
+++ b/testsrc/Globtest.hs
@@ -44,7 +44,9 @@ globtest thetest =
                         bp ++ "/ZZZ", bp ++ "/a/bcd",
                         bp ++ "/a/bcd/efg"]
                  mapM_ touch [bp ++ "/a/D", bp ++ "/aab/F", bp ++ "/aaa/zzzF",
-                              bp ++ "/a/bcd/EF", bp ++ "/a/bcd/efg/ha"]
+                              bp ++ "/a/bcd/EF", bp ++ "/a/bcd/efg/ha",
+                             bp ++ "/a/foo", bp ++ "/a/afoo",
+                             bp ++ "/a/a-foo", bp ++ "/a/a.foo"]
 #ifndef mingw32_HOST_OS
                  createSymbolicLink (preppath "broken") (preppath "sym1")
                  createSymbolicLink (preppath "broken") (preppath "sym2")
@@ -76,7 +78,8 @@ test_one_dir =
 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"]
+         glob (preppath "a/bcd/*g") >>= eq "a/bcd/*g" [preppath "a/bcd/efg"],
+         glob (preppath "a/*.foo") >>= eq "a/*.foo" [preppath "a/a.foo"]
         ]
 
 test_dirnames = 
diff --git a/testsrc/WildMatchtest.hs b/testsrc/WildMatchtest.hs
index 368c26f..034c3fa 100644
--- a/testsrc/WildMatchtest.hs
+++ b/testsrc/WildMatchtest.hs
@@ -41,7 +41,9 @@ test_wildCheckCase =
      f0 "a" "b",
      f "[\\]" "\\",
      f "[!\\]" "a",
-     f0 "[!\\]" "\\"]
+     f0 "[!\\]" "\\",
+     f0 "*.deb" "thedebianthing",
+     f0 "a/*.foo" "testtmp/a/D"]
      
 tests = TestList [TestLabel "wildCheckCase" (TestList test_wildCheckCase)]
 

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list