From 9d6c49b58ec83f2ced04bad806aa831f7a762207 Mon Sep 17 00:00:00 2001
From: Ian Lynagh <igloo@earth.li>
Date: Sat, 21 Jul 2007 00:21:19 +0000
Subject: [PATCH] Add a test for Data.Map, for a bug on the libraries@ list

---
 tests/Makefile          |  7 +++++++
 tests/all.T             |  5 +++++
 tests/datamap001.hs     | 14 ++++++++++++++
 tests/datamap001.stdout |  1 +
 4 files changed, 27 insertions(+)
 create mode 100644 tests/Makefile
 create mode 100644 tests/all.T
 create mode 100644 tests/datamap001.hs
 create mode 100644 tests/datamap001.stdout

diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 00000000..6a0abcf1
--- /dev/null
+++ b/tests/Makefile
@@ -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
index 00000000..b76a634a
--- /dev/null
+++ b/tests/all.T
@@ -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
index 00000000..253690a4
--- /dev/null
+++ b/tests/datamap001.hs
@@ -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
index 00000000..3b2a864d
--- /dev/null
+++ b/tests/datamap001.stdout
@@ -0,0 +1 @@
+fromList [(3,"b"),(5,"x")]
-- 
GitLab