Move lexNum to base/tests
authorIan Lynagh <igloo@earth.li>
Sat, 19 Nov 2011 23:19:34 +0000 (23:19 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 19 Nov 2011 23:19:34 +0000 (23:19 +0000)
tests/all.T
tests/lexNum.hs [new file with mode: 0644]
tests/lexNum.stdout [new file with mode: 0644]

index e46fdb2..1f1ba2a 100644 (file)
@@ -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 (file)
index 0000000..fb63034
--- /dev/null
@@ -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 (file)
index 0000000..92cb063
--- /dev/null
@@ -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","")]