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


The following commit has been merged in the master branch:
commit ad95b275aebefa037d9bb43dc89cf6eff61cca1f
Author: John Goerzen <jgoerzen at complete.org>
Date:   Tue Nov 23 05:43:44 2004 +0100

    Adding tests
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.5--patch-108)

diff --git a/ChangeLog b/ChangeLog
index 401dc0c..8f37c83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,21 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.5
 #
 
+2004-11-22 22:43:44 GMT	John Goerzen <jgoerzen at complete.org>	patch-108
+
+    Summary:
+      Adding tests
+    Revision:
+      missingh--head--0.5--patch-108
+
+
+    new files:
+     testsrc/ConfigParser/Maintest.hs
+
+    modified files:
+     ChangeLog testsrc/Tests.hs
+
+
 2004-11-22 22:06:45 GMT	John Goerzen <jgoerzen at complete.org>	patch-107
 
     Summary:
diff --git a/testsrc/ConfigParser/Parsertest.hs b/testsrc/ConfigParser/Maintest.hs
similarity index 75%
copy from testsrc/ConfigParser/Parsertest.hs
copy to testsrc/ConfigParser/Maintest.hs
index 37ffc1c..3d831c8 100644
--- a/testsrc/ConfigParser/Parsertest.hs
+++ b/testsrc/ConfigParser/Maintest.hs
@@ -1,4 +1,4 @@
-{- arch-tag: ConfigParser parser tests main file
+{- arch-tag: ConfigParser tests main file
 Copyright (C) 2004 John Goerzen <jgoerzen at complete.org>
 
 This program is free software; you can redistribute it and/or modify
@@ -16,13 +16,32 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -}
 
-module ConfigParser.Parsertest(tests) where
+module ConfigParser.Maintest(tests) where
 import HUnit
-import MissingH.ConfigParser.Parser
+import MissingH.ConfigParser
 import Testutil
 import Control.Exception
 
 test_basic =
+    let f msg inp exp conv = TestLabel msg $ TestCase $ assertEqual "" exp (conv (readstring empty inp))
+        in
+        [
+         f "empty doc, no sections" "" [] sections,
+         f "one empty line" "\n" [] sections,
+         f "comment line only" "#foo bar" [] sections,
+         f "comment line with \\n" "#foo bar\n" [] sections,
+         f "one empty sect" "[emptysect]" ["emptysect"] sections,
+         f "one empty sect w comment" "#foo bar\n[emptysect]\n" ["emptysect"]
+           sections,
+         f "assure comments not processed"
+           "# [nonexistant]\n[emptysect]\n" ["emptysect"] sections,
+         f "1 empty s w/comments"
+           "#fo\n[Cemptysect]\n#asdf boo\n  \n  # fnonexistantg"
+           ["Cemptysect"] sections
+        ]
+
+{-
+disabled_test_basic =
     let f msg inp exp = TestLabel msg $ TestCase $ assertEqual "" exp (parse_string inp) in
         [
         f "empty string" "" []
@@ -55,7 +74,7 @@ test_basic =
         ,f "simple default" "foo: bar" [("DEFAULT", [("foo", "bar")])]
                ]
 
-test_asserts =
+disabled_test_asserts =
         do
 
         assertRaises "e test1" (ErrorCall "Lexer: \"(string)\" (line 1, column 5):\nunexpected \"\\n\"\nexpecting Option separator")
@@ -64,15 +83,12 @@ test_asserts =
         assertRaises "e test2" (ErrorCall "Lexer: \"(string)\" (line 2, column 9):\nunexpected \"\\n\"\nexpecting Option separator")
                      ([] @=? parse_string "[sect1]\n#iiiiii \n  extensionline\n#foo")
 
-test_extensionlines =
+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),
-                  TestLabel "test_asserts" (TestCase test_asserts),
-                  TestLabel "test_extensionlines" (TestCase test_extensionlines)
-                 ]
\ No newline at end of file
+-}
+tests = TestList [TestLabel "test_basic" (TestList test_basic)]
diff --git a/testsrc/Tests.hs b/testsrc/Tests.hs
index 78f66ac..c856e11 100644
--- a/testsrc/Tests.hs
+++ b/testsrc/Tests.hs
@@ -28,6 +28,7 @@ import qualified Bitstest
 import qualified Printftest
 import qualified Network.FTP.Parsertest
 import qualified ConfigParser.Parsertest
+import qualified ConfigParser.Maintest
 
 test1 = TestCase ("x" @=? "x")
 
@@ -40,6 +41,7 @@ tests = TestList [TestLabel "test1" test1,
                  TestLabel "Bitstest" Bitstest.tests,
                  TestLabel "Network.FTP.Parser" Network.FTP.Parsertest.tests,
                  TestLabel "Printftest" Printftest.tests,
-                 TestLabel "ConfigParser.RunParser" ConfigParser.Parsertest.tests]
+                 TestLabel "ConfigParser.RunParser" ConfigParser.Parsertest.tests,
+                 TestLabel "ConfigParser.Main" ConfigParser.Maintest.tests]
 
 

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list