Skip to content

Commit 64bad2b

Browse files
authored
chore: avoid running cargo in tests
1 parent 573fb9c commit 64bad2b

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

bin/tests/_utils.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ pub fn test_cli(expression: &str, args: &[&str]) -> anyhow::Result<String> {
77
let mut fixture = NamedTempFile::with_suffix(".nix")?;
88
fixture.write_all(expression.as_bytes())?;
99

10-
let output = Command::new("cargo")
11-
.arg("run")
12-
.arg("--")
10+
let output = Command::new(env!("CARGO_BIN_EXE_statix"))
1311
.args(args)
1412
.arg(fixture.path())
1513
.output()?;
@@ -23,9 +21,7 @@ pub fn test_cli(expression: &str, args: &[&str]) -> anyhow::Result<String> {
2321

2422
#[allow(dead_code)]
2523
pub fn test_cli_stdin(input: &str, args: &[&str]) -> anyhow::Result<String> {
26-
let mut child = Command::new("cargo")
27-
.arg("run")
28-
.arg("--")
24+
let mut child = Command::new(env!("CARGO_BIN_EXE_statix"))
2925
.args(args)
3026
.stdin(Stdio::piped())
3127
.stdout(Stdio::piped())

0 commit comments

Comments
 (0)