@@ -56,23 +56,13 @@ test_expect_success 'apply --reject is incompatible with --3way' '
56
56
57
57
test_expect_success ' apply without --reject should fail' '
58
58
59
- if git apply patch.1
60
- then
61
- echo "Eh? Why?"
62
- exit 1
63
- fi
64
-
59
+ test_must_fail git apply patch.1 &&
65
60
test_cmp file1 saved.file1
66
61
'
67
62
68
63
test_expect_success ' apply without --reject should fail' '
69
64
70
- if git apply --verbose patch.1
71
- then
72
- echo "Eh? Why?"
73
- exit 1
74
- fi
75
-
65
+ test_must_fail git apply --verbose patch.1 &&
76
66
test_cmp file1 saved.file1
77
67
'
78
68
@@ -81,47 +71,24 @@ test_expect_success 'apply with --reject should fail but update the file' '
81
71
cat saved.file1 >file1 &&
82
72
rm -f file1.rej file2.rej &&
83
73
84
- if git apply --reject patch.1
85
- then
86
- echo "succeeds with --reject?"
87
- exit 1
88
- fi
89
-
74
+ test_must_fail git apply --reject patch.1 &&
90
75
test_cmp file1 expected &&
91
76
92
77
cat file1.rej &&
93
-
94
- if test -f file2.rej
95
- then
96
- echo "file2 should not have been touched"
97
- exit 1
98
- fi
78
+ test_path_is_missing file2.rej
99
79
'
100
80
101
81
test_expect_success ' apply with --reject should fail but update the file' '
102
82
103
83
cat saved.file1 >file1 &&
104
84
rm -f file1.rej file2.rej file2 &&
105
85
106
- if git apply --reject patch.2 >rejects
107
- then
108
- echo "succeeds with --reject?"
109
- exit 1
110
- fi
111
-
112
- test -f file1 && {
113
- echo "file1 still exists?"
114
- exit 1
115
- }
86
+ test_must_fail git apply --reject patch.2 >rejects &&
87
+ test_path_is_missing file1 &&
116
88
test_cmp file2 expected &&
117
89
118
90
cat file2.rej &&
119
-
120
- if test -f file1.rej
121
- then
122
- echo "file2 should not have been touched"
123
- exit 1
124
- fi
91
+ test_path_is_missing file1.rej
125
92
126
93
'
127
94
@@ -130,25 +97,12 @@ test_expect_success 'the same test with --verbose' '
130
97
cat saved.file1 >file1 &&
131
98
rm -f file1.rej file2.rej file2 &&
132
99
133
- if git apply --reject --verbose patch.2 >rejects
134
- then
135
- echo "succeeds with --reject?"
136
- exit 1
137
- fi
138
-
139
- test -f file1 && {
140
- echo "file1 still exists?"
141
- exit 1
142
- }
100
+ test_must_fail git apply --reject --verbose patch.2 >rejects &&
101
+ test_path_is_missing file1 &&
143
102
test_cmp file2 expected &&
144
103
145
104
cat file2.rej &&
146
-
147
- if test -f file1.rej
148
- then
149
- echo "file2 should not have been touched"
150
- exit 1
151
- fi
105
+ test_path_is_missing file1.rej
152
106
153
107
'
154
108
0 commit comments