Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions tests/Parse/NumberTests.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module Parse.NumberTests exposing (suite)

import Compiler.Parse.Number as N
import Compiler.Parse.Primitives as P
import Expect
import Test exposing (Test)


suite : Test
suite =
Test.describe "Parse.Number"
[ Test.test "1" <|
\_ ->
singleNumber "1"
|> Expect.equal (Ok (N.Int 1))
, Test.test "1000" <|
\_ ->
singleNumber "1000"
|> Expect.equal (Ok (N.Int 1000))
, Test.test "1_000" <|
\_ ->
singleNumber "1_000"
|> Expect.equal (Ok (N.Int 1000))
]


singleNumber : String -> Result () N.Number
singleNumber =
P.fromByteString (N.number (\_ _ -> ()) (\_ _ _ -> ())) (\_ _ -> ())
Loading