Elm Exactly
Results / elm /

ParseErrorStringEscapeUnclosedTest

Tags:elm19-compile-errorelm-spec

Checks, in A Standard Definition of Elm?:restriction core-escape-unicodefigure core-escapes

Not translated into Lean for the mechanisation of the book: see why.

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
A Unicode escape in a string with no closing brace, `"\u{12"`, is rejected with a BAD UNICODE ESCAPE syntax error.

Results

elm-0.19.1

pass
Output
Compiling ...-- BAD UNICODE ESCAPE --------------- src/ParseErrorStringEscapeUnclosedTest.elm

I ran into an invalid Unicode escape:

12|     "\u{12"
         ^^^^^
Here are some examples of valid Unicode escapes:

    \u{0041}
    \u{03BB}
    \u{6728}
    \u{1F60A}

Notice that the code point is always surrounded by curly braces. Maybe you are
missing the opening or closing curly brace?

Detected problems in 1 module.

elm-0.19.2

pass
Output
Compiling ...-- BAD UNICODE ESCAPE --------------- src/ParseErrorStringEscapeUnclosedTest.elm

I ran into an invalid Unicode escape:

12|     "\u{12"
         ^^^^^
Here are some examples of valid Unicode escapes:

    \u{0041}
    \u{03BB}
    \u{6728}
    \u{1F60A}

Notice that the code point is always surrounded by curly braces. Maybe you are
missing the opening or closing curly brace?

Detected problems in 1 module.

elm-0.19.3

pass
Output
Compiling ...-- BAD UNICODE ESCAPE --------------- src/ParseErrorStringEscapeUnclosedTest.elm

I ran into an invalid Unicode escape:

12|     "\u{12"
         ^^^^^
Here are some examples of valid Unicode escapes:

    \u{0041}
    \u{03BB}
    \u{6728}
    \u{1F60A}

Notice that the code point is always surrounded by curly braces. Maybe you are
missing the opening or closing curly brace?

Detected problems in 1 module.

lamdera-1.5.0

pass
Output
Detected problems in 1 module.
-- BAD UNICODE ESCAPE --------------- src/ParseErrorStringEscapeUnclosedTest.elm

I ran into an invalid Unicode escape:

12|     "\u{12"
         ^^^^^
Here are some examples of valid Unicode escapes:

    \u{0041}
    \u{03BB}
    \u{6728}
    \u{1F60A}

Notice that the code point is always surrounded by curly braces. Maybe you are
missing the opening or closing curly brace?

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm/ParseErrorStringEscapeUnclosedTest] in its title.

Source

The -- CHECK: lines give the expected output.

module ParseErrorStringEscapeUnclosedTest exposing (..)
{-| A Unicode escape in a string with no closing brace, `"\u{12"`, is rejected with a BAD UNICODE ESCAPE syntax error.
-}
-- TAGS: elm19-compile-error
-- TAGS: elm-spec, core-escape-unicode, fig:core-escapes
-- COMPILE-ERROR: BAD UNICODE ESCAPE
-- CHECK: -- BAD UNICODE ESCAPE -
x =
"\u{12"

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.