diff options
author | Evan Martin <evan.martin@gmail.com> | 2023-08-30 00:08:54 -0700 |
---|---|---|
committer | Evan Martin <evan.martin@gmail.com> | 2023-08-30 00:08:54 -0700 |
commit | 00dcdbeb609ec3acda30aaa712dfcc22df008460 (patch) | |
tree | 61982e9a53fa40aac2d8f259108e9c60e78faa4b | |
parent | 3b9daf3516d0d8a05b4c0f07dbf30afcd90a92a7 (diff) | |
download | n2-00dcdbeb609ec3acda30aaa712dfcc22df008460.tar.gz |
add currently-failing test case for issue #83
-rw-r--r-- | tests/e2e/basic.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/e2e/basic.rs b/tests/e2e/basic.rs index a78cc1d..93c0cf4 100644 --- a/tests/e2e/basic.rs +++ b/tests/e2e/basic.rs @@ -267,3 +267,29 @@ build out: echo Ok(()) } + +// Repro for issue #83. +#[cfg(unix)] +#[test] +fn eval_twice() -> anyhow::Result<()> { + let space = TestSpace::new()?; + space.write( + "build.ninja", + &[ + TOUCH_RULE, + " +var = 123 +rule custom + command = $cmd $var +build out: custom + cmd = echo $var hello +", + ] + .join("\n"), + )?; + + let out = space.run_expect(&mut n2_command(vec!["out"]))?; + // WRONG(#83): this should be `echo 123 hello 123`. + assert_output_contains(&out, "echo hello 123"); + Ok(()) +} |