Commit 1752a9b3 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Rename lexNum test to lex001, and expand it

parent ba5bea9b
......@@ -19,7 +19,7 @@ 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, [''])
test('lex001', normal, compile_and_run, [''])
test('take001', extra_run_opts('1'), compile_and_run, [''])
test('genericNegative001', extra_run_opts('-1'), compile_and_run, [''])
test('ix001', normal, compile_and_run, [''])
module Main where
import Text.ParserCombinators.ReadP
import qualified Text.Read.Lex
= [ "0x3y",
......@@ -7,7 +10,12 @@ testStrings
"Wibble Foo",
......@@ -24,5 +32,8 @@ testStrings
main = mapM test testStrings
test s = print (lex s)
test s = do print s
print (lex s)
print (readP_to_S Text.Read.Lex.lex s)
putStrLn ""
[(Number (MkNumber 16 [3]),"y")]
[(Number (MkNumber 16 [3,10,11]),"x")]
[(Number (MkNumber 8 [3]),"9y")]
[(Number (MkNumber 8 [3,3,4]),"z")]
[(Ident "NaN","")]
[(Ident "NaNx","")]
[(Ident "Infinity","")]
[(Ident "Infinityx","")]
"Wibble Foo"
[("Wibble"," Foo")]
[(Ident "Wibble"," Foo")]
[(Ident "Wibble8_","+")]
[(Number (MkDecimal [3,4] Nothing Nothing),"yy")]
[(Number (MkDecimal [3,4] (Just [4]) Nothing),"x")]
[(Number (MkDecimal [0,3,4] (Just [4]) Nothing),"x")]
[(Number (MkDecimal [3,1] (Just [4,5]) (Just (-6))),"y")]
[(Number (MkDecimal [4,9] (Just [2]) Nothing),"v")]
[(Number (MkDecimal [0,4,9] (Just [2]) Nothing),"v")]
[(Number (MkDecimal [3,5] Nothing (Just (-3))),"x")]
[(Number (MkDecimal [0,3,5] Nothing (Just (-3))),"x")]
[(Number (MkDecimal [3,5] Nothing (Just 3)),"y")]
[(Number (MkDecimal [8,3] (Just [3]) (Just (-22))),"")]
[(Number (MkDecimal [0,8,3] (Just [3]) (Just (-22))),"")]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment