diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/asset/parser/invalid-utf8.et | 4 | ||||
| -rw-r--r-- | test/asset/parser/utf8.et | 4 | ||||
| -rw-r--r-- | test/script/parser.et | 5 |
3 files changed, 13 insertions, 0 deletions
diff --git a/test/asset/parser/invalid-utf8.et b/test/asset/parser/invalid-utf8.et new file mode 100644 index 0000000..7f6b4fd --- /dev/null +++ b/test/asset/parser/invalid-utf8.et @@ -0,0 +1,4 @@ +# Script with invalid UTF-8: the byte 0xE9 is Latin-1 é, not valid UTF-8 +test Test: + let x = "café" + guard (x == x) diff --git a/test/asset/parser/utf8.et b/test/asset/parser/utf8.et new file mode 100644 index 0000000..d0c06e1 --- /dev/null +++ b/test/asset/parser/utf8.et @@ -0,0 +1,4 @@ +# Script with valid non-ASCII UTF-8 content: Šíleně žluťoučký kůň … +test Test: + let x = "… úpěl ďábelské ódy “‘quoted’”" + guard (x == x) diff --git a/test/script/parser.et b/test/script/parser.et index 5c45876..5843afe 100644 --- a/test/script/parser.et +++ b/test/script/parser.et @@ -22,3 +22,8 @@ test Parser: expect_load_failure using p of "function-fail" giving "parse-error" expect_load_success using p of "tags" expect_load_success using p of "type-annotation" + +test ParseUtf8: + spawn as p + expect_load_success using p of "utf8" + expect_load_failure using p of "invalid-utf8" giving "parse-error" |