Skip to content

Commit b0dfb17

Browse files
authored
cli: snapshot output to svg (#663)
1 parent a57a842 commit b0dfb17

File tree

3 files changed

+167
-0
lines changed

3 files changed

+167
-0
lines changed

.github/workflows/rust.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
- "**"
99
pull_request:
1010

11+
env:
12+
RUST_BACKTRACE: 1
13+
CARGO_TERM_COLOR: always
14+
CLICOLOR: 1
15+
1116
jobs:
1217
pre_job:
1318
runs-on: ubuntu-22.04
Lines changed: 147 additions & 0 deletions
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use snapbox::{cmd::Command, file};
2+
3+
#[test]
4+
fn example_sql_svg() {
5+
let expected = file!["../src/snapshots/example.svg": TermSvg];
6+
let bin_path = snapbox::cmd::cargo_bin("squawk");
7+
Command::new(bin_path)
8+
.env("CLICOLOR_FORCE", "1")
9+
.env("SQUAWK_DISABLE_GITHUB_ANNOTATIONS", "1")
10+
.arg("../../example.sql")
11+
.assert()
12+
.code(1) // squawk returns 1 when it finds violations
13+
.stderr_eq("")
14+
.stdout_eq(expected.raw());
15+
}

0 commit comments

Comments
 (0)