Add a test for Data.Map, for a bug on the libraries@ list
authorIan Lynagh <igloo@earth.li>
Sat, 21 Jul 2007 00:21:19 +0000 (00:21 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 21 Jul 2007 00:21:19 +0000 (00:21 +0000)
tests/Makefile [new file with mode: 0644]
tests/all.T [new file with mode: 0644]
tests/datamap001.hs [new file with mode: 0644]
tests/datamap001.stdout [new file with mode: 0644]

diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644 (file)
index 0000000..6a0abcf
--- /dev/null
@@ -0,0 +1,7 @@
+# This Makefile runs the tests using GHC's testsuite framework.  It
+# assumes the package is part of a GHC build tree with the testsuite
+# installed in ../../../testsuite.
+
+TOP=../../../testsuite
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
diff --git a/tests/all.T b/tests/all.T
new file mode 100644 (file)
index 0000000..b76a634
--- /dev/null
@@ -0,0 +1,5 @@
+# This is a test script for use with GHC's testsuite framework, see
+# http://darcs.haskell.org/testsuite
+
+test('datamap001', normal, compile_and_run, [''])
+
diff --git a/tests/datamap001.hs b/tests/datamap001.hs
new file mode 100644 (file)
index 0000000..253690a
--- /dev/null
@@ -0,0 +1,14 @@
+
+{-
+In the 6.6 era this printed [(5,"x")]; should be [(3,"b"),(5,"a")]
+-}
+
+module Main (main) where
+
+import Data.Map
+
+main :: IO ()
+main = do let m = fromList [(3,"b"),(5,"a")]
+              f k a = Just "x"
+              m' = updateAt f 1 m
+          print m'
diff --git a/tests/datamap001.stdout b/tests/datamap001.stdout
new file mode 100644 (file)
index 0000000..3b2a864
--- /dev/null
@@ -0,0 +1 @@
+fromList [(3,"b"),(5,"x")]