Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neunenak committed Dec 3, 2024
1 parent e6d21f0 commit db1ff03
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 34 deletions.
54 changes: 27 additions & 27 deletions tests/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ test! {
args: ("a"),
stdout: "",
stderr: "
error: Unterminated string
β€”β€”β–Ά justfile:1:6
β”‚
1 β”‚ a b= ':
β”‚ ^
",
Error: Unterminated string
╭─[justfile:1:6]
β”‚
1 β”‚ a b= ':
───╯
",
status: EXIT_FAILURE,
}

Expand All @@ -201,12 +201,12 @@ test! {
args: ("a"),
stdout: "",
stderr: r#"
error: Unterminated string
β€”β€”β–Ά justfile:1:6
β”‚
1 β”‚ a b= ":
β”‚ ^
"#,
Error: Unterminated string
╭─[justfile:1:6]
β”‚
1 β”‚ a b= ":
───╯
"#,
status: EXIT_FAILURE,
}

Expand Down Expand Up @@ -234,11 +234,11 @@ test! {
args: ("a"),
stdout: "",
stderr: "
error: Unterminated string
β€”β€”β–Ά justfile:1:6
β”‚
1 β”‚ a b= ''':
β”‚ ^^^
Error: Unterminated string
╭─[justfile:1:6]
β”‚
1 β”‚ a b= ''':
───╯
",
status: EXIT_FAILURE,
}
Expand All @@ -251,11 +251,11 @@ test! {
args: ("a"),
stdout: "",
stderr: r#"
error: Unterminated string
β€”β€”β–Ά justfile:1:6
β”‚
1 β”‚ a b= """:
β”‚ ^^^
Error: Unterminated string
╭─[justfile:1:6]
β”‚
1 β”‚ a b= """:
───╯
"#,
status: EXIT_FAILURE,
}
Expand Down Expand Up @@ -517,11 +517,11 @@ fn unicode_escape_too_long() {
.status(1)
.stderr(
r#"
error: unicode escape sequence starting with `\u{FFFFFFF` longer than six hex digits
β€”β€”β–Ά justfile:1:6
β”‚
1 β”‚ x := "\u{FFFFFFFFFF}"
β”‚ ^^^^^^^^^^^^^^^^
Error: unicode escape sequence starting with `\u{FFFFFFF` longer than six hex digits
╭─[justfile:1:6]
β”‚
1 β”‚ x := "\u{FFFFFFFFFF}"
───╯
"#,
)
.run();
Expand Down
3 changes: 2 additions & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ impl Test {
fn compare_string(name: &str, have: &str, want: &str) -> bool {
let equal = have == want;
if !equal {
eprintln!("Bad {name}: {}", StrComparison::new(&have, &want));
//eprintln!("Bad {name}: {}", StrComparison::new(&have, &want));
eprintln!("Bad {name}:\n{}||\n-------------\n{}||\n=========", &have, &want);
}
equal
}
Expand Down
12 changes: 6 additions & 6 deletions tests/working_directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,12 @@ fn attribute_with_nocd_is_forbidden() {
)
.stderr(
"
error: Recipe `bar` has both `[no-cd]` and `[working-directory]` attributes
β€”β€”β–Ά justfile:3:1
β”‚
3 β”‚ bar:
β”‚ ^^^
",
Error: Recipe `bar` has both `[no-cd]` and `[working-directory]` attributes
╭─[justfile:3:1]
β”‚
3 β”‚ bar:
───╯
"
)
.status(EXIT_FAILURE)
.run();
Expand Down

0 comments on commit db1ff03

Please sign in to comment.