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


The following commit has been merged in the master branch:
commit f5592fa68def69d9f6a757d3b84714caf7ca88c9
Author: John Goerzen <jgoerzen at complete.org>
Date:   Wed Dec 1 03:01:53 2004 +0100

    Added tests for no default situation
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.5--patch-128)

diff --git a/ChangeLog b/ChangeLog
index c3414a2..85b5fd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.5
 #
 
+2004-11-30 20:01:53 GMT	John Goerzen <jgoerzen at complete.org>	patch-128
+
+    Summary:
+      Added tests for no default situation
+    Revision:
+      missingh--head--0.5--patch-128
+
+
+    modified files:
+     ChangeLog testsrc/ConfigParser/Maintest.hs
+
+
 2004-11-30 18:45:21 GMT	John Goerzen <jgoerzen at complete.org>	patch-127
 
     Summary:
diff --git a/testsrc/ConfigParser/Maintest.hs b/testsrc/ConfigParser/Maintest.hs
index ed46728..ed41c6f 100644
--- a/testsrc/ConfigParser/Maintest.hs
+++ b/testsrc/ConfigParser/Maintest.hs
@@ -83,7 +83,22 @@ test_defaults =
       -- default bool
       ]
 
+test_nodefault =
+    let cp = (p "def: ault\n[sect1]\nfoo: bar\nbaz: quuz\nint: 2\nfloat: 3\nbool: yes\n[sect4]\ndef: different"){usedefault = False} in
+      [
+       f2 "default item" (Left (NoOption "def", "get")) (get cp "sect1" "def")
+      ,f2 "normal item" (Right "bar") (get cp "sect1" "foo")
+      ,f2 "no option" (Left (NoOption "abc", "get")) (get cp "sect1" "abc")
+      ,f2 "no section" (Left (NoSection "sect2", "get")) (get cp "sect2" "foo")
+      ,f2 "default from bad sect" (Left (NoSection "sect2", "get")) (get cp "sect2" "def")
+      ,f2 "overriding default" (Right "different") (get cp "sect4" "def")
+      -- not in haskell: ,f2 "using default feature"
+      -- default int
+      -- default float
+      -- default bool
+      ]
      
 
 tests = TestList [TestLabel "test_basic" (TestList test_basic),
-                 TestLabel "test_defaults" (TestList test_defaults)]
+                 TestLabel "test_defaults" (TestList test_defaults),
+                 TestLabel "test_nodefault" (TestList test_nodefault)]

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list