Commit 5f612a9
committed
t2000: modernize path checks to use helper functions
Replace bare 'test -f/-d' and 'test ! -h ... && test -f/-d'
assertions with their dedicated test_path_is_* helpers:
- 'test -f path0 && test -d path1 && test -f path1/file1'
becomes individual test_path_is_file/test_path_is_dir calls.
- 'test ! -h <path> && test -d/-f <path>' patterns become
test_path_is_dir_not_symlink/test_path_is_file_not_symlink calls.
These helpers produce clearer diagnostic output on failure
(e.g. 'File path0 doesn't exist') rather than a bare exit code,
making test failures easier to debug.
Found via:
git grep 'test -[efd]' t/
CC: Christian Couder <christian.couder@gmail.com>
CC: Karthik Nayak <karthik.188@gmail.com>
CC: Justin Tobler <jltobler@gmail.com>
CC: Siddharth Asthana <siddharthasthana31@gmail.com>
CC: Ayush Chandekar <ayu.chandekar@gmail.com>
Signed-off-by: alibaba0010 <zakariyahali100@gmail.com>1 parent 41688c1 commit 5f612a9
1 file changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
0 commit comments