diff mbox series

[v2,02/15] t0066: remove dependency between unrelated tests

Message ID 20220509175159.2948802-3-kioplato@gmail.com (mailing list archive)
State New, archived
Headers show
Series iterate dirs before or after their contents | expand

Commit Message

Plato Kiorpelidis May 9, 2022, 5:51 p.m. UTC
Two unrelated tests were using the same path for testing. That's
incorrect because if the test that depends on the other test, which
creates the directory hierarcy, is ran using the --run flag then it
will fail, even though it should pass, because the path doesn't exist.
Unrelated tests should not have dependencies among them.

Signed-off-by: Plato Kiorpelidis <kioplato@gmail.com>
---
 t/t0066-dir-iterator.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/t/t0066-dir-iterator.sh b/t/t0066-dir-iterator.sh
index 807c43d447..801749eb7e 100755
--- a/t/t0066-dir-iterator.sh
+++ b/t/t0066-dir-iterator.sh
@@ -63,9 +63,11 @@  test_expect_success 'begin should fail upon inexistent paths' '
 '
 
 test_expect_success 'begin should fail upon non directory paths' '
+	>some-file &&
+
 	echo "dir_iterator_begin failure: ENOTDIR" >expected-non-dir-output &&
 
-	test_must_fail test-tool dir-iterator ./dir/b >actual-non-dir-output &&
+	test_must_fail test-tool dir-iterator ./some-file >actual-non-dir-output &&
 
 	test_cmp expected-non-dir-output actual-non-dir-output
 '