diff options
Diffstat (limited to 'testsuite/tests/lib/Lex')
-rw-r--r-- | testsuite/tests/lib/Lex/Makefile | 3 | ||||
-rw-r--r-- | testsuite/tests/lib/Lex/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/lib/Lex/lexNum.hs | 28 | ||||
-rw-r--r-- | testsuite/tests/lib/Lex/lexNum.stdout | 17 |
4 files changed, 50 insertions, 0 deletions
diff --git a/testsuite/tests/lib/Lex/Makefile b/testsuite/tests/lib/Lex/Makefile new file mode 100644 index 0000000000..9101fbd40a --- /dev/null +++ b/testsuite/tests/lib/Lex/Makefile @@ -0,0 +1,3 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk diff --git a/testsuite/tests/lib/Lex/all.T b/testsuite/tests/lib/Lex/all.T new file mode 100644 index 0000000000..8c198fb90c --- /dev/null +++ b/testsuite/tests/lib/Lex/all.T @@ -0,0 +1,2 @@ +test('lexNum', normal, compile_and_run, ['']) + diff --git a/testsuite/tests/lib/Lex/lexNum.hs b/testsuite/tests/lib/Lex/lexNum.hs new file mode 100644 index 0000000000..fb63034b52 --- /dev/null +++ b/testsuite/tests/lib/Lex/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/testsuite/tests/lib/Lex/lexNum.stdout b/testsuite/tests/lib/Lex/lexNum.stdout new file mode 100644 index 0000000000..92cb063178 --- /dev/null +++ b/testsuite/tests/lib/Lex/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","")] |