File tree Expand file tree Collapse file tree 1 file changed +18
-18
lines changed Expand file tree Collapse file tree 1 file changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -53,30 +53,30 @@ with Git's dedicated test helpers like `test_path_is_file`.
53
53
54
54
#### Steps to Complete
55
55
1 . Find a test script using old-style path checks:
56
- ``` sh
57
- git grep " test -[efd]" t/
58
- ```
56
+ ``` sh
57
+ git grep " test -[efd]" t/
58
+ ```
59
59
60
60
2 . Look for patterns like:
61
- ``` sh
62
- test -f path/to/file # old way
63
- test_path_is_file path/to/file # new way
61
+ ``` sh
62
+ test -f path/to/file # old way
63
+ test_path_is_file path/to/file # new way
64
64
65
- test -d some/directory # old way
66
- test_path_is_dir some/directory # new way
67
- ```
65
+ test -d some/directory # old way
66
+ test_path_is_dir some/directory # new way
67
+ ```
68
68
69
69
3 . Important: Only replace checks that are actually testing for conditions, not
70
70
those used in flow control. For example:
71
- ``` sh
72
- # DON'T change this - it's flow control
73
- if test -e " file.txt" ; then
74
- do_something
75
- fi
76
-
77
- # DO change this - it's a test assertion
78
- test -e " file.txt" || error " file.txt should exist"
79
- ```
71
+ ``` sh
72
+ # DON'T change this - it's flow control
73
+ if test -e " file.txt" ; then
74
+ do_something
75
+ fi
76
+
77
+ # DO change this - it's a test assertion
78
+ test -e " file.txt" || error " file.txt should exist"
79
+ ```
80
80
81
81
#### Notes
82
82
- Start small: Pick a test file with just a few instances to convert
You can’t perform that action at this time.
0 commit comments