Skip to content

Commit 61bf134

Browse files
committed
[GSoC Patch] Modernize Test Path Checking: test -(e|f|d)
test -e changed to test_path_exists test -f changed to test_path_is_file Signed-off-by: Sampriyo Guin <[email protected]>
1 parent 683c54c commit 61bf134

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

t/chainlint/chained-subshell.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
6 ) &&
66
7
77
8 cut "-d " -f actual | (read s1 s2 s3 &&
8-
9 test -f $s1 ?!LINT: missing '&&'?!
8+
9 test_path_is_file $s1 ?!LINT: missing '&&'?!
99
10 test $(cat $s2) = tree2path1 &&
1010
11 test $(cat $s3) = tree3path1)

t/chainlint/chained-subshell.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mkdir sub && (
88

99
# LINT: preceding command pipes to subshell on same line
1010
cut "-d " -f actual | (read s1 s2 s3 &&
11-
test -f $s1
11+
test_path_is_file $s1
1212
test $(cat $s2) = tree2path1 &&
1313
# LINT: closing subshell ")" correctly detected on same line as "$(...)"
1414
test $(cat $s3) = tree3path1)

t/chainlint/function.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
5
55
6 remove_object() {
66
7 file=$(sha1_file "$*") &&
7-
8 test -e "$file" ?!LINT: missing '&&'?!
7+
8 test_path_exists "$file" ?!LINT: missing '&&'?!
88
9 rm -f "$file"
99
10 } ?!LINT: missing '&&'?!
1010
11

t/chainlint/function.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sha1_file() {
77
# LINT: broken &&-chain in function and after function
88
remove_object() {
99
file=$(sha1_file "$*") &&
10-
test -e "$file"
10+
test_path_exists "$file"
1111
rm -f "$file"
1212
}
1313

0 commit comments

Comments
 (0)