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


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

    More CP tests
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.5--patch-112)

diff --git a/ChangeLog b/ChangeLog
index 3315e31..a3732bd 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:57:20 GMT	John Goerzen <jgoerzen at complete.org>	patch-112
+
+    Summary:
+      More CP tests
+    Revision:
+      missingh--head--0.5--patch-112
+
+
+    modified files:
+     ChangeLog TODO testsrc/ConfigParser/Maintest.hs
+
+
 2004-11-22 22:53:37 GMT	John Goerzen <jgoerzen at complete.org>	patch-111
 
     Summary:
diff --git a/TODO b/TODO
index bbd683b..8943eb6 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,6 @@
 arch-tag: TODO file
 
+START WITH: test_defaults from OCaml
 Printf:
  make %H work 
 
diff --git a/testsrc/ConfigParser/Maintest.hs b/testsrc/ConfigParser/Maintest.hs
index 52f5a44..632ddda 100644
--- a/testsrc/ConfigParser/Maintest.hs
+++ b/testsrc/ConfigParser/Maintest.hs
@@ -22,10 +22,11 @@ import MissingH.ConfigParser
 import Testutil
 import Control.Exception
 
+p inp = readstring empty inp
+f msg inp exp conv = TestLabel msg $ TestCase $ assertEqual "" exp (conv (p inp))
+f2 msg exp res = TestLabel msg $ TestCase $ assertEqual "" exp res
+
 test_basic =
-    let p inp = readstring empty inp
-        f msg inp exp conv = TestLabel msg $ TestCase $ assertEqual "" exp (conv (p inp))
-        in
         [
          f "empty doc, no sections" "" [] sections,
          f "one empty line" "\n" [] sections,
@@ -60,4 +61,13 @@ test_basic =
               "o1" @=? get cp "DEFAULT" "v1"
         ]
 
-tests = TestList [TestLabel "test_basic" (TestList test_basic)]
+test_defaults = 
+    let cp = p "def: ault\n[sect1]\nfoo: bar\nbaz: quuz\nint: 2\nfloat: 3\nbool: yes" in
+      [
+       f2 "default item" "ault" (get cp "sect1" "def")
+      ]
+
+     
+
+tests = TestList [TestLabel "test_basic" (TestList test_basic),
+                 TestLabel "test_defaults" (TestList test_defaults)]

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list