Fix tests

This commit is contained in:
Richard Feldman 2024-02-27 11:25:40 -05:00
parent 6978ca7bf3
commit ffd72b184b
No known key found for this signature in database
GPG Key ID: F1F21AA5B1D9E43B
6 changed files with 27 additions and 25 deletions

View File

@ -4530,7 +4530,7 @@ mod test_reporting {
test_report!(
record_type_tab,
"f : { foo \t }",
@r"
@r###"
TAB CHARACTER in tmp/record_type_tab/Test.roc
I encountered a tab character:
@ -4538,14 +4538,14 @@ mod test_reporting {
4 f : { foo }
^
Tab characters are not allowed, use spaces instead.
"
Tab characters are not allowed in Roc code. Please use spaces instead!
"###
);
test_report!(
comment_with_tab,
"# comment with a \t\n4",
@r"
@r###"
TAB CHARACTER in tmp/comment_with_tab/Test.roc
I encountered a tab character:
@ -4553,8 +4553,8 @@ mod test_reporting {
4 # comment with a
^
Tab characters are not allowed, use spaces instead.
"
Tab characters are not allowed in Roc code. Please use spaces instead!
"###
);
test_report!(
@ -5407,7 +5407,7 @@ mod test_reporting {
test_report!(
weird_escape,
r#""abc\qdef""#,
@r#"
@r###"
WEIRD ESCAPE in tmp/weird_escape/Test.roc
I was partway through parsing a string literal, but I got stuck here:
@ -5425,7 +5425,7 @@ mod test_reporting {
- An escaped backslash: \\
- A unicode code point: \u(00FF)
- An interpolated string: $(myVariable)
"#
"###
);
test_report!(
@ -6253,7 +6253,7 @@ In roc, functions are always written as a lambda, like{}
pattern_in_parens_open,
indoc!(
r"
$( a
\( a
"
),
@r"
@ -6262,7 +6262,7 @@ In roc, functions are always written as a lambda, like{}
I am partway through parsing a pattern in parentheses, but I got stuck
here:
4 $( a
4 \( a
5
6
^
@ -6276,7 +6276,7 @@ In roc, functions are always written as a lambda, like{}
pattern_in_parens_end_comma,
indoc!(
r"
$( a,
\( a,
"
),
@r"
@ -6285,7 +6285,7 @@ In roc, functions are always written as a lambda, like{}
I am partway through parsing a pattern in parentheses, but I got stuck
here:
4 $( a,
4 \( a,
5
6
^
@ -6299,7 +6299,7 @@ In roc, functions are always written as a lambda, like{}
pattern_in_parens_end,
indoc!(
r"
$( a
\( a
"
),
@r"
@ -6308,7 +6308,7 @@ In roc, functions are always written as a lambda, like{}
I am partway through parsing a pattern in parentheses, but I got stuck
here:
4 $( a
4 \( a
5
6
^
@ -6322,7 +6322,7 @@ In roc, functions are always written as a lambda, like{}
unfinished_closure_pattern_in_parens,
indoc!(
r"
x = $( a
x = \( a
)
"
),
@ -6331,7 +6331,7 @@ In roc, functions are always written as a lambda, like{}
I was partway through parsing a function, but I got stuck here:
4 x = $( a
4 x = \( a
5 )
^
@ -6343,7 +6343,7 @@ In roc, functions are always written as a lambda, like{}
pattern_in_parens_indent_open,
indoc!(
r"
$(
\(
"
),
@r"
@ -6352,7 +6352,7 @@ In roc, functions are always written as a lambda, like{}
I am partway through parsing a pattern in parentheses, but I got stuck
here:
4 $(
4 \(
5
6
^

View File

@ -1883,7 +1883,7 @@ fn task_always_twice() {
@Effect inner
effectAfter : Effect a, (a -> Effect b) -> Effect b
effectAfter = $(@Effect thunk), transform -> transform (thunk {})
effectAfter = \(@Effect thunk), transform -> transform (thunk {})
Task a err : Effect (Result a err)
@ -1987,7 +1987,7 @@ fn todo_bad_error_message() {
@Effect inner
effectAfter : Effect a, (a -> Effect b) -> Effect b
effectAfter = $(@Effect thunk), transform -> transform (thunk {})
effectAfter = \(@Effect thunk), transform -> transform (thunk {})
Task a err : Effect (Result a err)
@ -3220,7 +3220,7 @@ fn recursively_build_effect() {
always = \x -> @XEffect (\{} -> x)
after : XEffect a, (a -> XEffect b) -> XEffect b
after = $(@XEffect e), toB ->
after = \(@XEffect e), toB ->
@XEffect \{} ->
when toB (e {}) is
@XEffect e2 ->

View File

@ -952,7 +952,7 @@ fn phantom_polymorphic() {
zero = Point (@World {}) 0 0
add : Point a -> Point a
add = $(Point c x y) -> (Point c x y)
add = \(Point c x y) -> (Point c x y)
add zero
#"

View File

@ -577,7 +577,7 @@ fn tuple_length_polymorphism() {
b = (1, 2, 44)
f : (I64, I64)a, (I64, I64)b -> I64
f = $(x1, x2), (x3, x4) -> x1 + x2 + x3 + x4
f = \(x1, x2), (x3, x4) -> x1 + x2 + x3 + x4
f a b
"

View File

@ -2562,7 +2562,7 @@ fn recursively_build_effect() {
always = \x -> @XEffect (\{} -> x)
after : XEffect a, (a -> XEffect b) -> XEffect b
after = $(@XEffect e), toB ->
after = \(@XEffect e), toB ->
@XEffect \{} ->
when toB (e {}) is
@XEffect e2 ->

View File

@ -3955,7 +3955,9 @@ fn to_space_report<'a>(
let doc = alloc.stack([
alloc.reflow("I encountered a tab character:"),
alloc.region(region),
alloc.reflow("Tab characters are not allowed, use spaces instead."),
alloc.reflow(
"Tab characters are not allowed in Roc code. Please use spaces instead!",
),
]);
Report {