[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:06:23 UTC 2010
The following commit has been merged in the master branch:
commit a7a0eafdb53b5e3f500ae3e4ec996fd67289cade
Author: John Goerzen <jgoerzen at complete.org>
Date: Thu Dec 29 00:04:06 2005 +0100
Added unit tests for spanList
diff --git a/testsrc/Listtest.hs b/testsrc/Listtest.hs
index 8d97e42..44fc39d 100644
--- a/testsrc/Listtest.hs
+++ b/testsrc/Listtest.hs
@@ -188,6 +188,16 @@ test_strToAL =
"\"one\",1.0\n\"n\\nl\",2.0\n"
]
+test_spanList =
+ let f func inp exp = TestLabel (show inp) $ TestCase $ exp @=? spanList func inp
+ in
+ [f (contains "foo") "Testfoobar" ("Testf", "oobar"),
+ f (\_ -> True) "Testasdf" ("Testasdf", ""),
+ f (\_ -> False) "Testasdf" ("", "Testasdf"),
+ f (contains "foo") "" ("", ""),
+ f (contains "foo") "foo" ("f", "oo")]
+
+
tests = TestList [TestLabel "delFromAL" (TestList test_delFromAL),
TestLabel "addToAL" (TestList test_addToAL),
TestLabel "split" (TestList test_split),
@@ -201,7 +211,8 @@ tests = TestList [TestLabel "delFromAL" (TestList test_delFromAL),
TestLabel "contains" (TestList test_contains),
TestLabel "strFromAL & strToAL" (TestList test_strToAL),
TestLabel "fixedWidth" (TestList test_fixedWidth),
- TestLabel "subIndex" (TestList test_subIndex)]
+ TestLabel "subIndex" (TestList test_subIndex),
+ TestLabel "spanList" (TestList test_spanList)]
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list