[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 14:48:31 UTC 2010
The following commit has been merged in the master branch:
commit 6f35a687b6f9dc4b9fe9d92119667027b7c44c0a
Author: John Goerzen <jgoerzen at complete.org>
Date: Tue Nov 23 05:53:37 2004 +0100
More work on CP tests
Keywords:
(jgoerzen at complete.org--projects/missingh--head--0.5--patch-111)
diff --git a/ChangeLog b/ChangeLog
index 1464aec..3315e31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
# arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.5
#
+2004-11-22 22:53:37 GMT John Goerzen <jgoerzen at complete.org> patch-111
+
+ Summary:
+ More work on CP tests
+ Revision:
+ missingh--head--0.5--patch-111
+
+
+ modified files:
+ ChangeLog TODO testsrc/ConfigParser/Maintest.hs
+
+
2004-11-22 22:49:29 GMT John Goerzen <jgoerzen at complete.org> patch-110
Summary:
diff --git a/TODO b/TODO
index 3a90697..bbd683b 100644
--- a/TODO
+++ b/TODO
@@ -3,6 +3,9 @@ arch-tag: TODO file
Printf:
make %H work
-Test configparser according to spec
+test configparser:
+ * according to ocaml spec
+ * with various default options
+ * exception system
tests for new Parsec stuff
diff --git a/testsrc/ConfigParser/Maintest.hs b/testsrc/ConfigParser/Maintest.hs
index 691e539..52f5a44 100644
--- a/testsrc/ConfigParser/Maintest.hs
+++ b/testsrc/ConfigParser/Maintest.hs
@@ -48,58 +48,16 @@ test_basic =
, f "comments in option text"
"[s1]\no1: v1#v2\n"
"v1#v2" (\cp -> get cp "s1" "o1")
-
+ , TestLabel "mult options" $ TestCase $
+ do let cp = p "\n#foo\n[sect1]\n\n#iiii \no1: v1\no2: v2\no3: v3"
+ ["o1", "o2", "o3"] @=? options cp "sect1"
+ ["sect1"] @=? sections cp
+ "v2" @=? get cp "sect1" "o2"
+ , TestLabel "sectionless option" $ TestCase $
+ do let cp = p "v1: o1\n[sect1]\nv2: o2"
+ "o1" @=? get cp "sect1" "v1"
+ "o2" @=? get cp "sect1" "v2"
+ "o1" @=? get cp "DEFAULT" "v1"
]
-{-
-disabled_test_basic =
- let f msg inp exp = TestLabel msg $ TestCase $ assertEqual "" exp (parse_string inp) in
- [
- f "empty string" "" []
-
- ,f "one empty line" "\n" []
- -- These two should go to OCaml
- ,f "one empty comment" "#" []
- ,f "one empty comment eol" "#\n" []
- ,f "one comment line" "#foo bar" []
- ,f "one comment line with eol" "#foo bar\n" []
- ,f "one empty section" "[emptysect]" [("emptysect", [])]
- ,f "one empty section w/eol" "[emptysect]\n" [("emptysect", [])]
- ,f "comment and empty sect noeol" "#foo bar\n[emptysect]"
- [("emptysect", [])]
- ,f "comment and empty sect" "#foo bar\n[emptysect]\n" [("emptysect", [])]
- ,f "comments2" "# [nonexistant]\n[emptysect]\n" [("emptysect", [])]
- ,f "comments3" "#fo\n[Cemptysect]\n#asdf boo\n \n # fnonexistantg"
- [("Cemptysect", [])]
- ,f "comments4" "[emptysect]\n# [nonexistant]\n" [("emptysect", [])]
- ,f "simple section" "[sect1]\nfoo: bar\n" [("sect1", [("foo", "bar")])]
- ,f "comments5" "\n#foo\n[sect1]\n\n#iiii \no1: v1\no2: v2\no3: v3"
- [("sect1", [("o1", "v1"), ("o2", "v2"), ("o3", "v3")])]
- ,f "comments5ext" "\n#foo\n[sect1]\n\n#iiii \no1: v1\no2: v2\n o3: v3"
- [("sect1", [("o1", "v1"), ("o2", "v2\no3: v3")])]
- ,f "comments5eol" "\n#foo\n[sect1]\n\n#iiii \no1: v1\no2: v2\no3: v3\n"
- [("sect1", [("o1", "v1"), ("o2", "v2"), ("o3", "v3")])]
-
- ,f "default1" "v1: o1\n[sect1]\nv2: o2" [("DEFAULT", [("v1", "o1")]),
- ("sect1", [("v2", "o2")])]
- ,f "simple default" "foo: bar" [("DEFAULT", [("foo", "bar")])]
- ]
-
-disabled_test_asserts =
- do
-
- assertRaises "e test1" (ErrorCall "Lexer: \"(string)\" (line 1, column 5):\nunexpected \"\\n\"\nexpecting Option separator")
- ([] @=? parse_string "#foo\nthis is bad data")
-
- assertRaises "e test2" (ErrorCall "Lexer: \"(string)\" (line 2, column 9):\nunexpected \"\\n\"\nexpecting Option separator")
- ([] @=? parse_string "[sect1]\n#iiiiii \n extensionline\n#foo")
-
-disabled_test_extensionlines =
- let f inp exp = exp @=? parse_string inp in
- do
- f "[sect1]\nfoo: bar\nbaz: l1\n l2\n l3\n# c\nquux: asdf"
- [("sect1", [("foo", "bar"),
- ("baz", "l1\nl2\nl3"),
- ("quux", "asdf")])]
--}
tests = TestList [TestLabel "test_basic" (TestList test_basic)]
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list