From ca2ef7ba82f4a48541961577368a738911412114 Mon Sep 17 00:00:00 2001 From: DJRHails Date: Wed, 13 May 2020 11:17:33 +0100 Subject: [PATCH] Add a test for a single missing search path --- tests/tests.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/tests.rs b/tests/tests.rs index 8dedd61..6ebbd40 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -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() {