Support --script properly... hopefully

This commit is contained in:
nora 2023-01-03 20:38:15 +01:00
parent f649289b01
commit 5ac406e650
4 changed files with 184 additions and 53 deletions

3
tests/always_success.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
exit 0 # we reproduce! aren't we great?!

View file

@ -1,5 +1,7 @@
mod helper;
use std::path::Path;
use anyhow::Result;
use helper::run_test;
@ -44,3 +46,27 @@ fn unused() -> Result<()> {
},
)
}
#[test]
#[cfg_attr(windows, ignore)]
fn custom_script_success() -> Result<()> {
let script_path = Path::new(file!())
.parent()
.unwrap()
.join("always_success.sh")
.canonicalize()?;
run_test(
r##"
fn main() {}
"##,
r##"
fn main() {
loop {}
}
"##,
|opts| {
opts.script_path = Some(script_path);
},
)
}