[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:28 UTC 2010
The following commit has been merged in the master branch:
commit 8ada9037ef92725c21f87604f32bf4633c06bb1a
Author: John Goerzen <jgoerzen at complete.org>
Date: Sat Apr 8 03:29:02 2006 +0100
Adding new tests
diff --git a/testsrc/IOtest.hs b/testsrc/Globtest.hs
similarity index 73%
copy from testsrc/IOtest.hs
copy to testsrc/Globtest.hs
index 7f52eb3..852eabe 100644
--- a/testsrc/IOtest.hs
+++ b/testsrc/Globtest.hs
@@ -1,5 +1,5 @@
-{- arch-tag: IO tests main file
-Copyright (C) 2004 John Goerzen <jgoerzen at complete.org>
+{-
+Copyright (C) 2006 John Goerzen <jgoerzen at complete.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,12 +16,18 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-}
-module IOtest() where
+
+module Globtest(tests) where
import Test.HUnit
-import MissingH.IO
+import MissingH.Path.Glob
import MissingH.HUnit
+import MissingH.IO.HVFS
+defaultFS :: IO MemoryVFS
+defaultFS =
+
+tests = TestList [TestLabel "wildMatchCase" (TestList test_wildMatchCase)]
diff --git a/testsrc/Tests.hs b/testsrc/Tests.hs
index ae3cef7..872516c 100644
--- a/testsrc/Tests.hs
+++ b/testsrc/Tests.hs
@@ -39,6 +39,8 @@ import qualified HVIOtest
import qualified HVFStest
import qualified Timetest
import qualified Str.CSVtest
+import qualified WildMatchtest
+import qualified Globtest
test1 = TestCase ("x" @=? "x")
@@ -51,8 +53,10 @@ tests = TestList [TestLabel "test1" test1,
TestLabel "Map" Maptest.tests,
TestLabel "AnyDBM" AnyDBMtest.tests,
TestLabel "Path" Pathtest.tests,
+ TestLabel "WildMatch" WildMatchtest.tests,
TestLabel "HVIO" HVIOtest.tests,
TestLabel "HVFS" HVFStest.tests,
+ TestLabel "Glob" Globtest.tests,
TestLabel "MIMETypes" MIMETypestest.tests,
TestLabel "Bitstest" Bitstest.tests,
TestLabel "Network.FTP.Parser" Network.FTP.Parsertest.tests,
diff --git a/testsrc/WildMatchtest.hs b/testsrc/WildMatchtest.hs
new file mode 100644
index 0000000..9572cc5
--- /dev/null
+++ b/testsrc/WildMatchtest.hs
@@ -0,0 +1,49 @@
+{-
+Copyright (C) 2006 John Goerzen <jgoerzen at complete.org>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-}
+
+
+module WildMatchtest(tests) where
+import Test.HUnit
+import MissingH.Path.WildMatch
+import MissingH.HUnit
+
+test_wildMatchCase =
+ let f patt name = assertBool (patt ++ "," ++ name ++ " was false")
+ (wildMatchCase patt name)
+ f0 patt name = assertBool (patt ++ "," ++ name ++ " was true")
+ (not $ wildMatchCase patt name)
+ [f "asdf" "asdf",
+ f "?*?" "abc",
+ f "???*" "asd",
+ f "*???" "asd",
+ f "???" "asd",
+ f "*" "asd",
+ f "ab[cd]" "abc",
+ f "ab[!de]" "abc",
+ f0 "ab[de]" "abc",
+ f0 "??" "a",
+ f0 "a" "b",
+ f "[\\]" "\\",
+ f "[!\\]" "a",
+ f0 "[!\\]", "\\"]
+
+tests = TestList [TestLabel "wildMatchCase" (TestList test_wildMatchCase)]
+
+
+
+
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list