update test_gen str tests

This commit is contained in:
shua 2024-12-09 20:17:13 +01:00
parent bf2895237d
commit f90e63b484
No known key found for this signature in database
2 changed files with 12 additions and 12 deletions

View file

@ -692,7 +692,7 @@ fn str_from_utf8_fail_invalid_start_byte() {
indoc!(
r#"
when Str.fromUtf8 [97, 98, 0x80, 99] is
Err (BadUtf8 InvalidStartByte byteIndex) ->
Err (BadUtf8 {problem: InvalidStartByte, index: byteIndex}) ->
if byteIndex == 2 then
"a"
else
@ -712,7 +712,7 @@ fn str_from_utf8_fail_unexpected_end_of_sequence() {
indoc!(
r#"
when Str.fromUtf8 [97, 98, 99, 0xC2] is
Err (BadUtf8 UnexpectedEndOfSequence byteIndex) ->
Err (BadUtf8 {problem: UnexpectedEndOfSequence, index: byteIndex}) ->
if byteIndex == 3 then
"a"
else
@ -732,7 +732,7 @@ fn str_from_utf8_fail_expected_continuation() {
indoc!(
r#"
when Str.fromUtf8 [97, 98, 99, 0xC2, 0x00] is
Err (BadUtf8 ExpectedContinuation byteIndex) ->
Err (BadUtf8 {problem: ExpectedContinuation, index: byteIndex}) ->
if byteIndex == 3 then
"a"
else
@ -752,7 +752,7 @@ fn str_from_utf8_fail_overlong_encoding() {
indoc!(
r#"
when Str.fromUtf8 [97, 0xF0, 0x80, 0x80, 0x80] is
Err (BadUtf8 OverlongEncoding byteIndex) ->
Err (BadUtf8 {problem: OverlongEncoding, index: byteIndex}) ->
if byteIndex == 1 then
"a"
else
@ -772,7 +772,7 @@ fn str_from_utf8_fail_codepoint_too_large() {
indoc!(
r#"
when Str.fromUtf8 [97, 0xF4, 0x90, 0x80, 0x80] is
Err (BadUtf8 CodepointTooLarge byteIndex) ->
Err (BadUtf8 {problem: CodepointTooLarge, index: byteIndex}) ->
if byteIndex == 1 then
"a"
else
@ -792,7 +792,7 @@ fn str_from_utf8_fail_surrogate_half() {
indoc!(
r#"
when Str.fromUtf8 [97, 98, 0xED, 0xA0, 0x80] is
Err (BadUtf8 EncodesSurrogateHalf byteIndex) ->
Err (BadUtf8 {problem: EncodesSurrogateHalf, index: byteIndex}) ->
if byteIndex == 2 then
"a"
else

View file

@ -522,7 +522,7 @@ fn str_from_utf8_fail_invalid_start_byte() {
indoc!(
r#"
when Str.fromUtf8 [97, 98, 0x80, 99] is
Err (BadUtf8 InvalidStartByte byteIndex) ->
Err (BadUtf8 {problem: InvalidStartByte, index: byteIndex}) ->
if byteIndex == 2 then
"a"
else
@ -541,7 +541,7 @@ fn str_from_utf8_fail_unexpected_end_of_sequence() {
indoc!(
r#"
when Str.fromUtf8 [97, 98, 99, 0xC2] is
Err (BadUtf8 UnexpectedEndOfSequence byteIndex) ->
Err (BadUtf8 {problem: UnexpectedEndOfSequence, index: byteIndex}) ->
if byteIndex == 3 then
"a"
else
@ -560,7 +560,7 @@ fn str_from_utf8_fail_expected_continuation() {
indoc!(
r#"
when Str.fromUtf8 [97, 98, 99, 0xC2, 0x00] is
Err (BadUtf8 ExpectedContinuation byteIndex) ->
Err (BadUtf8 {problem: ExpectedContinuation, index: byteIndex}) ->
if byteIndex == 3 then
"a"
else
@ -579,7 +579,7 @@ fn str_from_utf8_fail_overlong_encoding() {
indoc!(
r#"
when Str.fromUtf8 [97, 0xF0, 0x80, 0x80, 0x80] is
Err (BadUtf8 OverlongEncoding byteIndex) ->
Err (BadUtf8 {problem: OverlongEncoding, index: byteIndex}) ->
if byteIndex == 1 then
"a"
else
@ -598,7 +598,7 @@ fn str_from_utf8_fail_codepoint_too_large() {
indoc!(
r#"
when Str.fromUtf8 [97, 0xF4, 0x90, 0x80, 0x80] is
Err (BadUtf8 CodepointTooLarge byteIndex) ->
Err (BadUtf8 {problem: CodepointTooLarge, index: byteIndex}) ->
if byteIndex == 1 then
"a"
else
@ -617,7 +617,7 @@ fn str_from_utf8_fail_surrogate_half() {
indoc!(
r#"
when Str.fromUtf8 [97, 98, 0xED, 0xA0, 0x80] is
Err (BadUtf8 EncodesSurrogateHalf byteIndex) ->
Err (BadUtf8 {problem: EncodesSurrogateHalf, index: byteIndex}) ->
if byteIndex == 2 then
"a"
else