Add a test for a single missing search path

This commit is contained in:
DJRHails 2020-05-13 11:17:33 +01:00 committed by David Peter
parent 65b65b32be
commit ca2ef7ba82
1 changed files with 26 additions and 0 deletions

View File

@ -117,6 +117,32 @@ fn test_multi_file() {
te.assert_output(&["b.foo", "test1", "test2"], "test1/b.foo");
}
/// Test search over multiple directory with missing
#[test]
fn test_multi_file_with_missing() {
let dirs = &["real"];
let files = &["real/a.foo", "real/b.foo"];
let te = TestEnv::new(dirs, files);
te.assert_output(
&["a.foo", "real", "fake"],
"real/a.foo",
);
te.assert_output(
&["", "real", "fake"],
"real/a.foo
real/b.foo",
);
te.assert_output(&["a.foo", "real"], "real/a.foo");
te.assert_output(
&["", "real", "fake1", "fake2"],
"real/a.foo
real/b.foo",
);
}
/// Explicit root path
#[test]
fn test_explicit_root_path() {