[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:47:48 UTC 2010


The following commit has been merged in the master branch:
commit 0554cc053818f37fdd55625dc1f6ae518fbe7f79
Author: John Goerzen <jgoerzen at complete.org>
Date:   Fri Nov 19 05:53:04 2004 +0100

    Updated test for parse problem
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.5--patch-91)

diff --git a/ChangeLog b/ChangeLog
index 45ebf7d..c402b0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.5
 #
 
+2004-11-18 22:53:04 GMT	John Goerzen <jgoerzen at complete.org>	patch-91
+
+    Summary:
+      Updated test for parse problem
+    Revision:
+      missingh--head--0.5--patch-91
+
+
+    modified files:
+     ChangeLog testsrc/ConfigParser/Parsertest.hs
+
+
 2004-11-18 22:48:59 GMT	John Goerzen <jgoerzen at complete.org>	patch-90
 
     Summary:
diff --git a/testsrc/ConfigParser/Parsertest.hs b/testsrc/ConfigParser/Parsertest.hs
index 5de1690..f5e72aa 100644
--- a/testsrc/ConfigParser/Parsertest.hs
+++ b/testsrc/ConfigParser/Parsertest.hs
@@ -23,25 +23,33 @@ import Testutil
 import Control.Exception
 
 test_basic =
-    let f msg inp exp = assertEqual msg exp (parse_string inp) in
-        do
+    let f msg inp exp = TestLabel msg $ TestCase $ assertEqual "" exp (parse_string inp) in
+        [
         f "empty string" "" []
-        f "one empty line" "\n" []
-        f "one comment line" "#foo bar" []
-        f "one comment line with eol" "#foo bar\n" []
-        f "one empty section" "[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"
+
+        ,f "one empty line" "\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\n o3: v3"
+        ,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")]),
+        ,f "default1" "v1: o1\n[sect1]\nv2: o2" [("DEFAULT", [("v1", "o1")]),
                                      ("sect1", [("v2", "o2")])]
-        f "simple default" "foo: bar" [("DEFAULT", [("foo", "bar")])]
+        ,f "simple default" "foo: bar" [("DEFAULT", [("foo", "bar")])]
 {-
         assertRaises "e test1" (ErrorCall "Lexer: \"(string)\" (line 1, column 5):\nunexpected \"\\n\"\nexpecting Option separator")
                       (f "" "#foo\nthis is bad data" [])
@@ -49,6 +57,7 @@ test_basic =
         assertRaises "e test2" (ErrorCall "Lexer: \"(string)\" (line 2, column 9):\nunexpected \"\\n\"\nexpecting Option separator")
                      (f "" "[sect1]\n#iiiiii \n  extensionline\n#foo" [])
 -}
+        ]
 
 test_extensionlines =
     let f inp exp = exp @=? parse_string inp in
@@ -58,6 +67,6 @@ test_extensionlines =
                       ("baz", "l1\nl2\nl3"),
                       ("quux", "asdf")])]
 
-tests = TestList [TestLabel "test_basic" (TestCase test_basic),
-                  TestLabel "test_extensionlines" (TestCase test_extensionlines)
+tests = TestList [TestLabel "test_basic" (TestList test_basic)
+--                  TestLabel "test_extensionlines" (TestCase test_extensionlines)
                  ]
\ No newline at end of file

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list