diff options
Diffstat (limited to 'testsuite/patch.tests')
-rwxr-xr-x | testsuite/patch.tests | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/patch.tests b/testsuite/patch.tests index c604b9c1d..2759d2ad4 100755 --- a/testsuite/patch.tests +++ b/testsuite/patch.tests | |||
@@ -212,6 +212,36 @@ patching file input | |||
212 | 666 | 212 | 666 |
213 | " \ | 213 | " \ |
214 | 214 | ||
215 | # testing "test name" "command(s)" "expected result" "file input" "stdin" | ||
216 | testing "patch creates new file" \ | ||
217 | 'patch 2>&1; echo $?; cat testfile; rm testfile' \ | ||
218 | "\ | ||
219 | creating testfile | ||
220 | 0 | ||
221 | qwerty | ||
222 | " "" "\ | ||
223 | --- /dev/null | ||
224 | +++ testfile | ||
225 | @@ -0,0 +1 @@ | ||
226 | +qwerty | ||
227 | " | ||
228 | |||
229 | # testing "test name" "command(s)" "expected result" "file input" "stdin" | ||
230 | testing "patch understands ...dir///dir..." \ | ||
231 | 'patch -p1 2>&1; echo $?' \ | ||
232 | "\ | ||
233 | patching file dir2///file | ||
234 | patch: can't open 'dir2///file': No such file or directory | ||
235 | 1 | ||
236 | " "" "\ | ||
237 | --- bogus_dir///dir2///file | ||
238 | +++ bogus_dir///dir2///file | ||
239 | @@ -1,2 +1,3 @@ | ||
240 | qwe | ||
241 | +asd | ||
242 | zxc | ||
243 | " | ||
244 | |||
215 | rm input.orig 2>/dev/null | 245 | rm input.orig 2>/dev/null |
216 | 246 | ||
217 | exit $FAILCOUNT | 247 | exit $FAILCOUNT |