Results / elm-parser /
ParserFloatTest
`Parser.float` parses a decimal number, with or without an exponent. `"3.14"` gives `Ok 3.14` and `"1.5e-2"` gives `Ok 0.015`. Among what is not tested: integers without a decimal point, signs, and rejected forms such as hexadecimal.
Results
elm-0.19.1
passran in 48 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. parsed_float: Ok 3.14 parsed_exp: Ok 0.015
elm-0.19.2
passran in 48 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. parsed_float: Ok 3.14 parsed_exp: Ok 0.015
elm-0.19.3
passran in 61 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. parsed_float: Ok 3.14 parsed_exp: Ok 0.015
lamdera-1.5.0
passran in 72 msOutput
parsed_float: Ok 3.14 parsed_exp: Ok 0.015
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-parser/ParserFloatTest] in its title.
Source
The -- CHECK: lines give the expected output.
module ParserFloatTest exposing (main)
{-| `Parser.float` parses a decimal number, with or without an exponent.
`"3.14"` gives `Ok 3.14` and `"1.5e-2"` gives `Ok 0.015`.
Among what is not tested: integers without a decimal point, signs, and
rejected forms such as hexadecimal.
-}
-- CHECK: parsed_float: Ok 3.14
-- CHECK: parsed_exp: Ok 0.015
import Html exposing (text)
import Parser
main =
let
_ = Debug.log "parsed_float" (Parser.run Parser.float "3.14")
_ = Debug.log "parsed_exp" (Parser.run Parser.float "1.5e-2")
in
text "done"