Move order test to integration tests

This commit is contained in:
Casey Rodarmor 2016-10-28 15:34:01 -07:00
parent a1722fe241
commit e011f91656
2 changed files with 41 additions and 7 deletions

View File

@ -61,3 +61,44 @@ fn simple() {
"echo hello\n", "echo hello\n",
) )
} }
#[test]
fn quiet() {
integration_test(
"quiet",
&[],
"default:\n @echo hello",
0,
"hello\n",
"",
)
}
#[test]
fn order() {
let text = "
b: a
echo b
@mv a b
a:
echo a
@touch F
@touch a
d: c
echo d
@rm c
c: b
echo c
@mv b c";
integration_test(
"order",
&["a", "d"],
text,
0,
"a\nb\nc\nd\n",
"echo a\necho b\necho c\necho d\n",
);
}

View File

@ -633,8 +633,6 @@ fn unknown_second_interpolation_variable() {
#[test] #[test]
fn run_order() { fn run_order() {
let tmp = tempdir::TempDir::new("run_order").unwrap_or_else(|err| panic!("tmpdir: failed to create temporary directory: {}", err));
let path = tmp.path().to_str().unwrap_or_else(|| panic!("tmpdir: path was not valid UTF-8")).to_owned();
let text = r" let text = r"
b: a b: a
@mv a b @mv a b
@ -649,11 +647,6 @@ d: c
c: b c: b
@mv b c"; @mv b c";
tokenize_success(text, "$N:N$>^_$$<N:$>^_$^_$$<N:N$>^_$$<N:N$>^_<."); tokenize_success(text, "$N:N$>^_$$<N:$>^_$^_$$<N:N$>^_$$<N:N$>^_<.");
super::std::env::set_current_dir(path).expect("failed to set current directory");
parse_success(text).run(&["a", "d"]).unwrap();
if let Err(_) = super::std::fs::metadata("F") {
panic!("recipes did not run");
}
} }
#[test] #[test]