Add a readInteger001 test
authorIan Lynagh <igloo@earth.li>
Thu, 1 Mar 2012 14:03:31 +0000 (14:03 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 1 Mar 2012 14:03:31 +0000 (14:03 +0000)
tests/all.T
tests/readInteger001.hs [new file with mode: 0644]
tests/readInteger001.stdout [new file with mode: 0644]

index 7addfd1..582a542 100644 (file)
@@ -19,6 +19,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('readInteger001', 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/readInteger001.hs b/tests/readInteger001.hs
new file mode 100644 (file)
index 0000000..10391e4
--- /dev/null
@@ -0,0 +1,7 @@
+
+main :: IO ()
+main = do f "100e12"
+          f "00123.456"
+
+f :: String -> IO ()
+f str = print (reads str :: [(Integer, String)])
diff --git a/tests/readInteger001.stdout b/tests/readInteger001.stdout
new file mode 100644 (file)
index 0000000..c71bf50
--- /dev/null
@@ -0,0 +1,2 @@
+[]
+[]