Skip to content

Commit

Permalink
Provide more sign-related tests for the float parser
Browse files Browse the repository at this point in the history
  • Loading branch information
mstream authored and jamesdbrock committed Jun 5, 2023
1 parent accf929 commit d6dd52c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ tokenParserFloatTest = do
-- parse float
parseTest "100.5" 100.5 testTokenParser.float

-- parse float prefixed with a plus sign
parseTest "+100.5" 100.5 testTokenParser.float

-- parse a negative float
parseTest "-100.5" (-100.5) testTokenParser.float

Expand All @@ -401,6 +404,9 @@ tokenParserFloatTest = do
-- parse float with exponent
parseTest "100.5e1" 1005.0 testTokenParser.float

-- parse a negative float with exponent
parseTest "-100.5e1" (-1005.0) testTokenParser.float

-- fail on nonfloat
parseErrorTestPosition testTokenParser.float "100.e1" $ mkPos 5

Expand Down

0 comments on commit d6dd52c

Please sign in to comment.