2 # Copyright 2008 by Denys Vlasenko
3 # Licensed under GPL v2, see file LICENSE for details.
7 # testing "test name" "options" "expected result" "file input" "stdin"
9 testing "patch with old_file == new_file" \
10 'patch; echo $?; cat input' \
23 --- input Jan 01 01:01:01 2000
24 +++ input Jan 01 01:01:01 2000
31 testing "patch with nonexistent old_file" \
32 'patch; echo $?; cat input' \
45 --- input.doesnt_exist Jan 01 01:01:01 2000
46 +++ input Jan 01 01:01:01 2000
53 testing "patch -R with nonexistent old_file" \
54 'patch -R; echo $?; cat input' \
67 --- input.doesnt_exist Jan 01 01:01:01 2000
68 +++ input Jan 01 01:01:01 2000
75 testing "patch detects already applied hunk" \
76 'patch 2>&1; echo $?; cat input' \
79 patch: hunk #1 FAILED at 1
80 patch: 1 out of 1 hunk FAILED
92 --- input.old Jan 01 01:01:01 2000
93 +++ input Jan 01 01:01:01 2000
100 # Currently fails (erroneously appends second "456" line):
101 false && testing "patch detects already applied hunk" \
102 'patch 2>&1; echo $?; cat input' \
105 patch: hunk #1 FAILED at 2
106 patch: 1 out of 1 hunk FAILED
118 --- input.old Jan 01 01:01:01 2000
119 +++ input Jan 01 01:01:01 2000