ParseErrorNumberBadHexDigitTest
Tags:elm19-compile-errorelm-spec
Checks, in A Standard Definition of Elm?:restriction core-constant-separated
Not translated into Lean for the mechanisation of the book: see why.
A hexadecimal literal containing a non-hex digit, `0x1g`, is rejected with a WEIRD HEXIDECIMAL syntax error. The expected heading keeps the spelling "HEXIDECIMAL" used in Elm's own error message.
Results
elm-0.19.1
passOutput
Compiling ...-- WEIRD HEXIDECIMAL ------------------- src/ParseErrorNumberBadHexDigitTest.elm
I thought I was reading a hexidecimal number until I got here:
14| 0x1g
^
Valid hexidecimal digits include 0123456789abcdefABCDEF, so I can only recognize
things like this:
0x2B
0x002B
0x00ffb3
Detected problems in 1 module.
elm-0.19.2
passOutput
Compiling ...-- WEIRD HEXIDECIMAL ------------------- src/ParseErrorNumberBadHexDigitTest.elm
I thought I was reading a hexidecimal number until I got here:
14| 0x1g
^
Valid hexidecimal digits include 0123456789abcdefABCDEF, so I can only recognize
things like this:
0x2B
0x002B
0x00ffb3
Detected problems in 1 module.
elm-0.19.3
passOutput
Compiling ...-- WEIRD HEXIDECIMAL ------------------- src/ParseErrorNumberBadHexDigitTest.elm
I thought I was reading a hexidecimal number until I got here:
14| 0x1g
^
Valid hexidecimal digits include 0123456789abcdefABCDEF, so I can only recognize
things like this:
0x2B
0x002B
0x00ffb3
Detected problems in 1 module.
lamdera-1.5.0
passOutput
Detected problems in 1 module.
-- WEIRD HEXIDECIMAL ------------------- src/ParseErrorNumberBadHexDigitTest.elm
I thought I was reading a hexidecimal number until I got here:
14| 0x1g
^
Valid hexidecimal digits include 0123456789abcdefABCDEF, so I can only recognize
things like this:
0x2B
0x002B
0x00ffb3
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm/ParseErrorNumberBadHexDigitTest] in its title.
Source
The -- CHECK: lines give the expected output.
module ParseErrorNumberBadHexDigitTest exposing (..)
{-| A hexadecimal literal containing a non-hex digit, `0x1g`, is rejected with a WEIRD HEXIDECIMAL syntax error.
The expected heading keeps the spelling "HEXIDECIMAL" used in Elm's own error message.
-}
-- TAGS: elm19-compile-error
-- TAGS: elm-spec, core-constant-separated
-- COMPILE-ERROR: WEIRD HEXIDECIMAL
-- CHECK: -- WEIRD HEXIDECIMAL -
x =
0x1g
Lean translation
No reduced program for Lean's evaluator: the test expects a compile error, so it has no meaning to evaluate. Static semantics: expected to be rejected, and eco's parser rejects it too. See the Lean mechanisation for which tests are in Lean, and why.