Skip to content

Commit 306d69b

Browse files
committed
test(cli): Verify terminal styling
This uses a new feature from snapbox that let's us render terminal styling in SVG files. This let's us see / visualize ANSI escape codes, including in github's UI (will render images, including side-by-side images for diffs).
1 parent d325f9b commit 306d69b

File tree

783 files changed

+11269
-2420
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

783 files changed

+11269
-2420
lines changed

Cargo.lock

+41-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ sha1 = "0.10.6"
9191
sha2 = "0.10.8"
9292
shell-escape = "0.1.5"
9393
supports-hyperlinks = "2.1.0"
94-
snapbox = { version = "0.5.0", features = ["diff", "path"] }
94+
snapbox = { version = "0.5.6", features = ["diff", "path", "term-svg"] }
9595
tar = { version = "0.4.40", default-features = false }
9696
tempfile = "3.9.0"
9797
thiserror = "1.0.56"

crates/cargo-test-support/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,7 @@ impl CargoCommand for snapbox::cmd::Command {
13191319
fn cargo_ui() -> Self {
13201320
Self::new(cargo_exe())
13211321
.with_assert(compare::assert_ui())
1322+
.env("CARGO_TERM_COLOR", "always")
13221323
.test_env()
13231324
}
13241325
}

tests/testsuite/cargo/help/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ fn case() {
88
.arg("--help")
99
.assert()
1010
.success()
11-
.stdout_matches(file!["stdout.log"])
11+
.stdout_matches(file!["stdout.term.svg"])
1212
.stderr_matches(str![""]);
1313
}

tests/testsuite/cargo/help/stdout.log

-40
This file was deleted.
+106
Loading

tests/testsuite/cargo/z_help/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ fn case() {
99
.args(["-Z", "help"])
1010
.assert()
1111
.success()
12-
.stdout_matches(file!["stdout.log"])
12+
.stdout_matches(file!["stdout.term.svg"])
1313
.stderr_matches(str![""]);
1414
}

tests/testsuite/cargo/z_help/stdout.log

-38
This file was deleted.

0 commit comments

Comments
 (0)