Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/54ce8383cc610977b50f571782f35d1322283a79

>---------------------------------------------------------------

commit 54ce8383cc610977b50f571782f35d1322283a79
Author: Ian Lynagh <[email protected]>
Date:   Thu Mar 1 13:57:54 2012 +0000

    Add a test for reading Doubles

>---------------------------------------------------------------

 tests/all.T                |    1 +
 tests/readDouble001.hs     |   11 +++++++++++
 tests/readDouble001.stdout |    6 ++++++
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/tests/all.T b/tests/all.T
index 4b7d905..7addfd1 100644
--- a/tests/all.T
+++ b/tests/all.T
@@ -18,6 +18,7 @@ test('unicode002',
      [''])
 test('data-fixed-show-read', normal, compile_and_run, [''])
 test('showDouble', normal, compile_and_run, [''])
+test('readDouble001', normal, compile_and_run, [''])
 test('hash001', normal, compile_and_run, [''])
 test('lex001', normal, compile_and_run, [''])
 test('take001', extra_run_opts('1'), compile_and_run, [''])
diff --git a/tests/readDouble001.hs b/tests/readDouble001.hs
new file mode 100644
index 0000000..f111ac5
--- /dev/null
+++ b/tests/readDouble001.hs
@@ -0,0 +1,11 @@
+
+main :: IO ()
+main = do f "Infinity"
+          f "-Infinity"
+          f "  -  Infinity  "
+          f "NaN"
+          f "-NaN"
+          f "  -  NaN  "
+
+f :: String -> IO ()
+f str = print (reads str :: [(Double, String)])
diff --git a/tests/readDouble001.stdout b/tests/readDouble001.stdout
new file mode 100644
index 0000000..ddbbe1e
--- /dev/null
+++ b/tests/readDouble001.stdout
@@ -0,0 +1,6 @@
+[(Infinity,"")]
+[(-Infinity,"")]
+[(-Infinity,"  ")]
+[(NaN,"")]
+[(NaN,"")]
+[(NaN,"  ")]



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to