-
Notifications
You must be signed in to change notification settings - Fork 831
[Strings] Fuzz and interpret all relevant StringNew methods #6526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fb8c6c6
93707ac
e52b750
32174ac
9e5f865
e634ad4
cdcf0d6
b0280eb
be8b6d6
8951580
5a5cde0
ef7985a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -414,6 +414,64 @@ | |
| ;; Concatenating these surrogates creates '𐍈'. | ||
| (string.concat (string.const "\ED\A0\80") (string.const "\ED\BD\88")) | ||
| ) | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling string.from_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: string.from_code_point => string("A") | ||
| (func $string.from_code_point (export "string.from_code_point") (result stringref) | ||
| (string.from_code_point | ||
| (i32.const 65) | ||
| ) | ||
| ) | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling unsigned_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: unsigned_code_point => string("\u0093") | ||
| (func $unsigned_code_point (export "unsigned_code_point") (result stringref) | ||
| (string.from_code_point | ||
| ;; This must be interpreted as unsigned, that is, in the escaped output | ||
| ;; the top byte is 0. | ||
| (i32.const 147) | ||
| ) | ||
| ) | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling weird_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: weird_code_point => string("\u03e8") | ||
| (func $weird_code_point (export "weird_code_point") (result stringref) | ||
| (string.from_code_point | ||
| (i32.const 0x3e8) | ||
| ) | ||
| ) | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling isolated_high_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: isolated_high_code_point => string("\ud800") | ||
| (func $isolated_high_code_point (export "isolated_high_code_point") (result stringref) | ||
| (string.from_code_point | ||
| (i32.const 0xD800) | ||
| ) | ||
| ) | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling isolated_low_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: isolated_low_code_point => string("\udc00") | ||
| (func $isolated_low_code_point (export "isolated_low_code_point") (result stringref) | ||
| (string.from_code_point | ||
| (i32.const 0xDC00) | ||
| ) | ||
| ) | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling surrogate_pair_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: surrogate_pair_code_point => string("\u286c") | ||
| (func $surrogate_pair_code_point (export "surrogate_pair_code_point") (result stringref) | ||
| (string.from_code_point | ||
| (i32.const 0x286c) ;; 𐍈 | ||
| ) | ||
| ) | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling invalid_code_point | ||
| ;; CHECK-NEXT: [trap invalid code point] | ||
| (func $invalid_code_point (export "invalid_code_point") (result stringref) | ||
| (string.from_code_point | ||
| (i32.const -83) | ||
| ) | ||
| ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other test cases to add: An isolated high surrogate:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, added. I also noticed a fuzz error on an unsigned case (that now works) that I also added. |
||
| ) | ||
| ;; CHECK: [fuzz-exec] calling new_wtf16_array | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: new_wtf16_array => string("ello") | ||
|
|
@@ -518,6 +576,27 @@ | |
|
|
||
| ;; CHECK: [fuzz-exec] calling concat-surrogates | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: concat-surrogates => string("\ud800\udf48") | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling string.from_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: string.from_code_point => string("A") | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling unsigned_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: unsigned_code_point => string("\u0093") | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling weird_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: weird_code_point => string("\u03e8") | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling isolated_high_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: isolated_high_code_point => string("\ud800") | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling isolated_low_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: isolated_low_code_point => string("\udc00") | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling surrogate_pair_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] note result: surrogate_pair_code_point => string("\u286c") | ||
|
|
||
| ;; CHECK: [fuzz-exec] calling invalid_code_point | ||
| ;; CHECK-NEXT: [trap invalid code point] | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing compare.1 | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing compare.10 | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing compare.2 | ||
|
|
@@ -540,6 +619,9 @@ | |
| ;; CHECK-NEXT: [fuzz-exec] comparing eq.5 | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing get_codeunit | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing get_length | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing invalid_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing isolated_high_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing isolated_low_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing new_2 | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing new_4 | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing new_empty | ||
|
|
@@ -551,3 +633,7 @@ | |
| ;; CHECK-NEXT: [fuzz-exec] comparing slice | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing slice-big | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing slice-unicode | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing string.from_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing surrogate_pair_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing unsigned_code_point | ||
| ;; CHECK-NEXT: [fuzz-exec] comparing weird_code_point | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is unchanged.