From 0a575763a166aea92da9b86ace7a3010b08177ff Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Thu, 1 Dec 2022 21:59:53 -0700 Subject: [PATCH 1/2] Change full path tests to be more resilient Use patterns that won't conflict with randomly generated portion of temporary directory Fixes: #1181 --- tests/tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tests.rs b/tests/tests.rs index 3de4559..0c7c3d7 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -263,12 +263,12 @@ fn test_and_plus_full_path() { let te = TestEnv::new(DEFAULT_DIRS, AND_EXTRA_FILES); te.assert_output( - &["three", "--full-path", "--and", "foo", "--and", "dir"], + &["three", "--full-path", "--and", "_foo", "--and", "/dir"], "one/two/three/directory_foo/", ); te.assert_output( - &["three", "--full-path", "--and", "two", "--and", "dir"], + &["three", "--full-path", "--and", "/two", "--and", "/dir"], "one/two/three/directory_foo/", ); } From 7ec795cd575908f14c80e3cc066cd284456ee0ce Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Sat, 3 Dec 2022 01:48:27 -0700 Subject: [PATCH 2/2] Change full-path tests to work on windows as well --- tests/tests.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/tests.rs b/tests/tests.rs index 0c7c3d7..b77eb65 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -263,12 +263,26 @@ fn test_and_plus_full_path() { let te = TestEnv::new(DEFAULT_DIRS, AND_EXTRA_FILES); te.assert_output( - &["three", "--full-path", "--and", "_foo", "--and", "/dir"], + &[ + "three", + "--full-path", + "--and", + "_foo", + "--and", + r"[/\\]dir", + ], "one/two/three/directory_foo/", ); te.assert_output( - &["three", "--full-path", "--and", "/two", "--and", "/dir"], + &[ + "three", + "--full-path", + "--and", + r"[/\\]two", + "--and", + r"[/\\]dir", + ], "one/two/three/directory_foo/", ); }