@matheusbsbs / matheus-bagliano / commits / ceeef863de
Fork 0

t5520: replace test -f with test-lib functions

Although `test -f` has the same functionality as test_path_is_file(), in the case where test_path_is_file() fails, we get much better debugging information. Replace `test -f` with test_path_is_file() so that future developers will have a better experience debugging these test cases. Also, in the case of `! test -f`, not only should that path not be a file, it shouldn't exist at all so replace it with test_path_is_missing(). Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Denton Liu committed Nov 12, 2019 at 15:07 UTC ceeef863defcb3d48e32915b37f2d748708c9fd4
1 file changed +5 -5
t/t5520-pull.sh
+5 -5
@@ -39,8 +39,8 @@ test_expect_success 'pulling into void' '
39 cd cloned &&
40 git pull ..
41 ) &&
42 - test -f file &&
43 - test -f cloned/file &&
42 + test_path_is_file file &&
43 + test_path_is_file cloned/file &&
44 test_cmp file cloned/file
45 '
46
@@ -50,8 +50,8 @@ test_expect_success 'pulling into void using master:master' '
50 cd cloned-uho &&
51 git pull .. master:master
52 ) &&
53 - test -f file &&
54 - test -f cloned-uho/file &&
53 + test_path_is_file file &&
54 + test_path_is_file cloned-uho/file &&
55 test_cmp file cloned-uho/file
56 '
57
@@ -99,7 +99,7 @@ test_expect_success 'pulling into void must not create an octopus' '
99 (
100 cd cloned-octopus &&
101 test_must_fail git pull .. master master &&
102 - ! test -f file
102 + test_path_is_missing file
103 )
104 '
105