From be2750a0a11b919fb03cc070074e430f88bdfa90 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sun, 8 May 2011 21:14:09 +0100 Subject: [PATCH] Add tests from testsuite/tests/h98 --- tests/Makefile | 7 +++++++ tests/all.T | 4 ++++ tests/enumDouble.hs | 3 +++ tests/enumDouble.stdout | 1 + tests/enumRatio.hs | 3 +++ tests/enumRatio.stdout | 1 + tests/readFloat.hs | 5 +++++ tests/readFloat.stderr | 1 + 8 files changed, 25 insertions(+) create mode 100644 tests/Makefile create mode 100644 tests/all.T create mode 100644 tests/enumDouble.hs create mode 100644 tests/enumDouble.stdout create mode 100644 tests/enumRatio.hs create mode 100644 tests/enumRatio.stdout create mode 100644 tests/readFloat.hs create mode 100644 tests/readFloat.stderr 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..4906495 --- /dev/null +++ b/tests/all.T @@ -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 index 0000000..458607d --- /dev/null +++ b/tests/enumDouble.hs @@ -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 index 0000000..a5093aa --- /dev/null +++ b/tests/enumDouble.stdout @@ -0,0 +1 @@ +1.0e20 diff --git a/tests/enumRatio.hs b/tests/enumRatio.hs new file mode 100644 index 0000000..79b733e --- /dev/null +++ b/tests/enumRatio.hs @@ -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 index 0000000..0d5cbaf --- /dev/null +++ b/tests/enumRatio.stdout @@ -0,0 +1 @@ +[1 % 1] diff --git a/tests/readFloat.hs b/tests/readFloat.hs new file mode 100644 index 0000000..02fd48e --- /dev/null +++ b/tests/readFloat.hs @@ -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 index 0000000..9299061 --- /dev/null +++ b/tests/readFloat.stderr @@ -0,0 +1 @@ +readFloat: Prelude.read: no parse -- 1.7.10.4