[commit: base] master: Move lexNum to base/tests (aa30f3c)
Ian Lynagh
igloo at earth.li
Sun Nov 20 01:12:35 CET 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/base
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/aa30f3cf43e692e9362f95e156ed855ea974a251
>---------------------------------------------------------------
commit aa30f3cf43e692e9362f95e156ed855ea974a251
Author: Ian Lynagh <igloo at earth.li>
Date: Sat Nov 19 23:19:34 2011 +0000
Move lexNum to base/tests
>---------------------------------------------------------------
tests/all.T | 1 +
tests/lexNum.hs | 28 ++++++++++++++++++++++++++++
tests/lexNum.stdout | 17 +++++++++++++++++
3 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/tests/all.T b/tests/all.T
index e46fdb2..1f1ba2a 100644
--- a/tests/all.T
+++ b/tests/all.T
@@ -19,4 +19,5 @@ test('unicode002',
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, [''])
diff --git a/tests/lexNum.hs b/tests/lexNum.hs
new file mode 100644
index 0000000..fb63034
--- /dev/null
+++ b/tests/lexNum.hs
@@ -0,0 +1,28 @@
+module Main where
+
+testStrings
+ = [ "0x3y",
+ "0X3abx",
+ "0o39y",
+ "0O334z",
+
+ "NaN",
+ "Infinity",
+
+ "34yy",
+ "34.4x",
+ "034.4x",
+ "31.45e-6y",
+ "49.2v",
+ "049.2v",
+ "35e-3x",
+ "035e-3x",
+ "35e+3y",
+ "83.3e-22",
+ "083.3e-22"
+ ]
+
+main = mapM test testStrings
+
+test s = print (lex s)
+
diff --git a/tests/lexNum.stdout b/tests/lexNum.stdout
new file mode 100644
index 0000000..92cb063
--- /dev/null
+++ b/tests/lexNum.stdout
@@ -0,0 +1,17 @@
+[("0x3","y")]
+[("0X3ab","x")]
+[("0o3","9y")]
+[("0O334","z")]
+[("NaN","")]
+[("Infinity","")]
+[("34","yy")]
+[("34.4","x")]
+[("034.4","x")]
+[("31.45e-6","y")]
+[("49.2","v")]
+[("049.2","v")]
+[("35e-3","x")]
+[("035e-3","x")]
+[("35e+3","y")]
+[("83.3e-22","")]
+[("083.3e-22","")]
More information about the Cvs-libraries
mailing list