Add tests from testsuite/tests/h98
authorIan Lynagh <igloo@earth.li>
Sun, 8 May 2011 20:14:09 +0000 (21:14 +0100)
committerIan Lynagh <igloo@earth.li>
Mon, 23 May 2011 17:52:23 +0000 (18:52 +0100)
tests/Makefile [new file with mode: 0644]
tests/all.T [new file with mode: 0644]
tests/enumDouble.hs [new file with mode: 0644]
tests/enumDouble.stdout [new file with mode: 0644]
tests/enumRatio.hs [new file with mode: 0644]
tests/enumRatio.stdout [new file with mode: 0644]
tests/readFloat.hs [new file with mode: 0644]
tests/readFloat.stderr [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..4906495
--- /dev/null
@@ -0,0 +1,4 @@
+
+test('readFloat', exit_code(1), compile_and_run, [''])
+test('enumDouble', normal, compile_and_run, [''])
+test('enumRatio', normal, compile_and_run, [''])
diff --git a/tests/enumDouble.hs b/tests/enumDouble.hs
new file mode 100644 (file)
index 0000000..458607d
--- /dev/null
@@ -0,0 +1,3 @@
+
+main :: IO ()
+main = print (succ (1.0e20 :: Double))
diff --git a/tests/enumDouble.stdout b/tests/enumDouble.stdout
new file mode 100644 (file)
index 0000000..a5093aa
--- /dev/null
@@ -0,0 +1 @@
+1.0e20
diff --git a/tests/enumRatio.hs b/tests/enumRatio.hs
new file mode 100644 (file)
index 0000000..79b733e
--- /dev/null
@@ -0,0 +1,3 @@
+
+import Data.Ratio
+main = print [ 1, 4%(3::Int) .. 1 ]
diff --git a/tests/enumRatio.stdout b/tests/enumRatio.stdout
new file mode 100644 (file)
index 0000000..0d5cbaf
--- /dev/null
@@ -0,0 +1 @@
+[1 % 1]
diff --git a/tests/readFloat.hs b/tests/readFloat.hs
new file mode 100644 (file)
index 0000000..02fd48e
--- /dev/null
@@ -0,0 +1,5 @@
+
+import Numeric
+
+main :: IO ()
+main = putStrLn $ showFloat (read "" :: Float) ""
diff --git a/tests/readFloat.stderr b/tests/readFloat.stderr
new file mode 100644 (file)
index 0000000..9299061
--- /dev/null
@@ -0,0 +1 @@
+readFloat: Prelude.read: no parse