Move Data.List tests to base/tests
authorIan Lynagh <igloo@earth.li>
Sat, 19 Nov 2011 23:23:29 +0000 (23:23 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 19 Nov 2011 23:23:29 +0000 (23:23 +0000)
tests/all.T
tests/genericNegative001.hs [new file with mode: 0644]
tests/genericNegative001.stdout [new file with mode: 0644]
tests/take001.hs [new file with mode: 0644]
tests/take001.stdout [new file with mode: 0644]

index 1f1ba2a..dc3483d 100644 (file)
@@ -20,4 +20,6 @@ test('data-fixed-show-read', normal, compile_and_run, [''])
 test('showDouble', normal, compile_and_run, [''])
 test('hash001', normal, compile_and_run, [''])
 test('lexNum', normal, compile_and_run, [''])
+test('take001', extra_run_opts('1'), compile_and_run, [''])
+test('genericNegative001', extra_run_opts('-1'), compile_and_run, [''])
 
diff --git a/tests/genericNegative001.hs b/tests/genericNegative001.hs
new file mode 100644 (file)
index 0000000..f59a42f
--- /dev/null
@@ -0,0 +1,8 @@
+-- Test for http://hackage.haskell.org/trac/ghc/ticket/2533
+import System.Environment
+import Data.List
+main = do 
+ (n:_) <- getArgs
+ print (genericTake (read n) "none taken")
+ print (genericDrop (read n) "none dropped")
+ print (genericSplitAt (read n) "none split")
diff --git a/tests/genericNegative001.stdout b/tests/genericNegative001.stdout
new file mode 100644 (file)
index 0000000..b8a0907
--- /dev/null
@@ -0,0 +1,3 @@
+""
+"none dropped"
+("","none split")
diff --git a/tests/take001.hs b/tests/take001.hs
new file mode 100644 (file)
index 0000000..a7a5314
--- /dev/null
@@ -0,0 +1,5 @@
+-- Test for bug #1219, F/B rule for take was too strict
+import System.Environment
+main = do 
+ (n:_) <- getArgs
+ print (map (const 'x') (take (read n) (undefined:undefined)))
diff --git a/tests/take001.stdout b/tests/take001.stdout
new file mode 100644 (file)
index 0000000..92232f6
--- /dev/null
@@ -0,0 +1 @@
+"x"