From: Ian Lynagh Date: Sat, 21 Jul 2007 00:21:19 +0000 (+0000) Subject: Add a test for Data.Map, for a bug on the libraries@ list X-Git-Tag: 2007-09-13~44 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=d60e3771dee3e21e4da1e683279559eda23ff754;p=ghc-base.git Add a test for Data.Map, for a bug on the libraries@ list --- diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..6a0abcf --- /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 0000000..b76a634 --- /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 0000000..253690a --- /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 0000000..3b2a864 --- /dev/null +++ b/tests/datamap001.stdout @@ -0,0 +1 @@ +fromList [(3,"b"),(5,"x")]