Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions test/core/names.wast
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,17 @@
(assert_return (invoke "ϔ") (i32.const 477))
(assert_return (invoke "ẛ") (i32.const 478))

(module
;; Test the escapes \r, \' and \u{...} with an underscore in names.
(func (export "\r") (result i32) (i32.const 0))
(func (export "\'") (result i32) (i32.const 1))
(func (export "\u{1_F600}") (result i32) (i32.const 2))
)

(assert_return (invoke "\0d") (i32.const 0))
(assert_return (invoke "'") (i32.const 1))
(assert_return (invoke "\f0\9f\98\80") (i32.const 2))

(module
;; Test that we can use indices instead of names to reference imports,
;; exports, functions and parameters.
Expand Down
15 changes: 15 additions & 0 deletions test/core/utf8-invalid-encoding.wast
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,18 @@
(module quote "(func (export \"\\u{00D800}\"))")
"malformed UTF-8 codepoint"
)

;; An underscore in a \u{...} escape must be between two hex digits.

(assert_malformed
(module quote "(func (export \"\\u{_1F600}\"))")
"illegal escape"
)
(assert_malformed
(module quote "(func (export \"\\u{1F600_}\"))")
"illegal escape"
)
(assert_malformed
(module quote "(func (export \"\\u{1__F600}\"))")
"illegal escape"
)
Loading