Skip to content

Commit d74eafc

Browse files
neunenakclaude
andcommitted
Update tests for ariadne error format
Update all integration test stderr expectations to match ariadne's output format, which uses '╭─[file:line:col]' and '───╯' instead of the previous 'β€”β€”β–Ά' and '^^^^' format. Also remove unused `StrComparison` import from tests/test.rs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a684186 commit d74eafc

36 files changed

+1029
-1438
lines changed

β€Žtests/alias.rsβ€Ž

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,12 @@ fn unknown_nested_alias() {
3232
",
3333
)
3434
.arg("b")
35-
.stderr(
36-
"\
37-
error: Alias `b` has an unknown target `foo::bar::baz`
38-
β€”β€”β–Ά justfile:3:7
39-
β”‚
40-
3 β”‚ alias b := foo::bar::baz
41-
β”‚ ^
42-
",
43-
)
35+
.stderr(r#"Error: Alias `b` has an unknown target `foo::bar::baz`
36+
╭─[justfile:3:7]
37+
β”‚
38+
3 β”‚ alias b := foo::bar::baz
39+
───╯
40+
"#)
4441
.failure();
4542
}
4643

β€Žtests/allow_missing.rsβ€Ž

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@ fn allow_missing_does_not_apply_to_compilation_errors() {
2525
Test::new()
2626
.justfile("bar: foo")
2727
.args(["--allow-missing", "foo"])
28-
.stderr(
29-
"
30-
error: Recipe `bar` has unknown dependency `foo`
31-
β€”β€”β–Ά justfile:1:6
32-
β”‚
33-
1 β”‚ bar: foo
34-
β”‚ ^^^
35-
",
36-
)
28+
.stderr(r#"Error: Recipe `bar` has unknown dependency `foo`
29+
╭─[justfile:1:6]
30+
β”‚
31+
1 β”‚ bar: foo
32+
───╯
33+
"#)
3734
.failure();
3835
}
3936

β€Žtests/arg_attribute.rsβ€Ž

Lines changed: 48 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,12 @@ fn pattern_invalid_regex_error() {
7676
foo bar:
7777
",
7878
)
79-
.stderr(
80-
"
81-
error: Failed to parse argument pattern
82-
β€”β€”β–Ά justfile:1:21
83-
β”‚
84-
1 β”‚ [arg('bar', pattern='{')]
85-
β”‚ ^^^
86-
caused by: regex parse error:
87-
{
88-
^
89-
error: repetition operator missing expression
90-
",
91-
)
79+
.stderr(r#"Error: Failed to parse argument pattern
80+
╭─[justfile:1:21]
81+
β”‚
82+
1 β”‚ [arg('bar', pattern='{')]
83+
───╯
84+
"#)
9285
.failure();
9386
}
9487

@@ -122,15 +115,12 @@ fn duplicate_attribute_error() {
122115
",
123116
)
124117
.args(["foo", "BAR"])
125-
.stderr(
126-
"
127-
error: Recipe attribute for argument `bar` first used on line 1 is duplicated on line 2
128-
β€”β€”β–Ά justfile:2:2
129-
β”‚
130-
2 β”‚ [arg('bar', pattern='BAR')]
131-
β”‚ ^^^
132-
",
133-
)
118+
.stderr(r#"Error: Recipe attribute for argument `bar` first used on line 1 is duplicated on line 2
119+
╭─[justfile:2:2]
120+
β”‚
121+
2 β”‚ [arg('bar', pattern='BAR')]
122+
───╯
123+
"#)
134124
.failure();
135125
}
136126

@@ -144,15 +134,12 @@ fn extra_keyword_error() {
144134
",
145135
)
146136
.args(["foo", "BAR"])
147-
.stderr(
148-
"
149-
error: Unknown keyword `foo` for `arg` attribute
150-
β€”β€”β–Ά justfile:1:28
151-
β”‚
152-
1 β”‚ [arg('bar', pattern='BAR', foo='foo')]
153-
β”‚ ^^^
154-
",
155-
)
137+
.stderr(r#"Error: Unknown keyword `foo` for `arg` attribute
138+
╭─[justfile:1:28]
139+
β”‚
140+
1 β”‚ [arg('bar', pattern='BAR', foo='foo')]
141+
───╯
142+
"#)
156143
.failure();
157144
}
158145

@@ -166,15 +153,12 @@ fn unknown_argument_error() {
166153
",
167154
)
168155
.arg("foo")
169-
.stderr(
170-
"
171-
error: Argument attribute for undefined argument `bar`
172-
β€”β€”β–Ά justfile:1:6
173-
β”‚
174-
1 β”‚ [arg('bar', pattern='BAR')]
175-
β”‚ ^^^^^
176-
",
177-
)
156+
.stderr(r#"Error: Argument attribute for undefined argument `bar`
157+
╭─[justfile:1:6]
158+
β”‚
159+
1 β”‚ [arg('bar', pattern='BAR')]
160+
───╯
161+
"#)
178162
.failure();
179163
}
180164

@@ -220,15 +204,12 @@ fn positional_arguments_cannot_follow_keyword_arguments() {
220204
",
221205
)
222206
.args(["foo", "BAR"])
223-
.stderr(
224-
"
225-
error: Positional attribute arguments cannot follow keyword attribute arguments
226-
β€”β€”β–Ά justfile:1:21
227-
β”‚
228-
1 β”‚ [arg(pattern='BAR', 'bar')]
229-
β”‚ ^^^^^
230-
",
231-
)
207+
.stderr(r#"Error: Positional attribute arguments cannot follow keyword attribute arguments
208+
╭─[justfile:1:21]
209+
β”‚
210+
1 β”‚ [arg(pattern='BAR', 'bar')]
211+
───╯
212+
"#)
232213
.failure();
233214
}
234215

@@ -351,15 +332,12 @@ fn pattern_requires_value() {
351332
foo bar:
352333
",
353334
)
354-
.stderr(
355-
"
356-
error: Attribute key `pattern` requires value
357-
β€”β€”β–Ά justfile:1:13
358-
β”‚
359-
1 β”‚ [arg('bar', pattern)]
360-
β”‚ ^^^^^^^
361-
",
362-
)
335+
.stderr(r#"Error: Attribute key `pattern` requires value
336+
╭─[justfile:1:13]
337+
β”‚
338+
1 β”‚ [arg('bar', pattern)]
339+
───╯
340+
"#)
363341
.failure();
364342
}
365343

@@ -372,15 +350,12 @@ fn short_requires_value() {
372350
foo bar:
373351
",
374352
)
375-
.stderr(
376-
"
377-
error: Attribute key `short` requires value
378-
β€”β€”β–Ά justfile:1:13
379-
β”‚
380-
1 β”‚ [arg('bar', short)]
381-
β”‚ ^^^^^
382-
",
383-
)
353+
.stderr(r#"Error: Attribute key `short` requires value
354+
╭─[justfile:1:13]
355+
β”‚
356+
1 β”‚ [arg('bar', short)]
357+
───╯
358+
"#)
384359
.failure();
385360
}
386361

@@ -393,14 +368,11 @@ fn value_requires_value() {
393368
foo bar:
394369
",
395370
)
396-
.stderr(
397-
"
398-
error: Attribute key `value` requires value
399-
β€”β€”β–Ά justfile:1:19
400-
β”‚
401-
1 β”‚ [arg('bar', long, value)]
402-
β”‚ ^^^^^
403-
",
404-
)
371+
.stderr(r#"Error: Attribute key `value` requires value
372+
╭─[justfile:1:19]
373+
β”‚
374+
1 β”‚ [arg('bar', long, value)]
375+
───╯
376+
"#)
405377
.failure();
406378
}

β€Žtests/assignment.rsβ€Ž

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@ fn set_export_parse_error() {
88
set export := fals
99
",
1010
)
11-
.stderr(
12-
"
13-
error: Expected keyword `true` or `false` but found identifier `fals`
14-
β€”β€”β–Ά justfile:1:15
15-
β”‚
16-
1 β”‚ set export := fals
17-
β”‚ ^^^^
18-
",
19-
)
11+
.stderr(r#"Error: Expected keyword `true` or `false` but found identifier `fals`
12+
╭─[justfile:1:15]
13+
β”‚
14+
1 β”‚ set export := fals
15+
───╯
16+
"#)
2017
.failure();
2118
}
2219

@@ -28,15 +25,12 @@ fn set_export_parse_error_eol() {
2825
set export :=
2926
",
3027
)
31-
.stderr(
32-
"
33-
error: Expected identifier, but found end of line
34-
β€”β€”β–Ά justfile:1:14
35-
β”‚
36-
1 β”‚ set export :=
37-
β”‚ ^
38-
",
39-
)
28+
.stderr(r#"Error: Expected identifier, but found end of line
29+
╭─[justfile:1:14]
30+
β”‚
31+
1 β”‚ set export :=
32+
───╯
33+
"#)
4034
.failure();
4135
}
4236

@@ -50,14 +44,11 @@ fn invalid_attributes_are_an_error() {
5044
",
5145
)
5246
.args(["--evaluate", "x"])
53-
.stderr(
54-
"
55-
error: Assignment `x` has invalid attribute `group`
56-
β€”β€”β–Ά justfile:2:1
57-
β”‚
58-
2 β”‚ x := 'foo'
59-
β”‚ ^
60-
",
61-
)
47+
.stderr(r#"Error: Assignment `x` has invalid attribute `group`
48+
╭─[justfile:2:1]
49+
β”‚
50+
2 β”‚ x := 'foo'
51+
───╯
52+
"#)
6253
.failure();
6354
}

0 commit comments

Comments
Β (0)