[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 15:10:40 UTC 2010
The following commit has been merged in the master branch:
commit 0f47df3d66b237874f28d0b5a352ea7a4b36ecb9
Author: John Goerzen <jgoerzen at complete.org>
Date: Thu Jun 29 01:04:27 2006 +0100
Fixed a bug with merge in ConfigParser
And added a test for it
diff --git a/MissingH/ConfigParser.hs b/MissingH/ConfigParser.hs
index 6a9c68e..1b4024c 100644
--- a/MissingH/ConfigParser.hs
+++ b/MissingH/ConfigParser.hs
@@ -249,7 +249,7 @@ merge src dest =
conv = optionxform dest
convFM :: CPOptions -> CPOptions
convFM = Map.fromList . map (\x -> (conv (fst x), snd x)) . Map.toList
- mergesects a b = Map.union b a
+ mergesects a b = Map.union a b
in
dest { content = Map.unionWith mergesects
(content dest) (Map.map convFM (content src)) }
diff --git a/testsrc/ConfigParser/Maintest.hs b/testsrc/ConfigParser/Maintest.hs
index ed10bbc..6abe033 100644
--- a/testsrc/ConfigParser/Maintest.hs
+++ b/testsrc/ConfigParser/Maintest.hs
@@ -130,8 +130,11 @@ test_instances =
test_merge =
let cp = p "test: foo"
+ cp2 = p "test: bar"
in [f2 "merge1" (cp) (merge emptyCP cp)
- ,f2 "merge2" (cp) (merge cp emptyCP)]
+ ,f2 "merge2" (cp) (merge cp emptyCP)
+ ,f2 "merge3" (cp2) (merge cp cp2)
+ ,f2 "merge4" (cp) (merge cp2 cp)]
test_remove =
let cp = forceEither $ readstring emptyCP "def:ault\n[sect1]\ns1o1: v1\ns1o2:v2\n[sect2]\ns2o1: v1\ns2o2: v2\n[sect3]"
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list