aboutsummaryrefslogtreecommitdiff
path: root/testsuite/patch.tests
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-10-24 17:11:55 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-10-24 17:11:55 +0200
commit17c838bc6da9ff7defb2a8d5ff539ec743acc1fc (patch)
tree1f22614f7fa3b230f25066174ac7fd5504400d36 /testsuite/patch.tests
parent1dacfbb1f466a2964cbf49855f336bcc1d25ebc0 (diff)
downloadbusybox-w32-17c838bc6da9ff7defb2a8d5ff539ec743acc1fc.tar.gz
busybox-w32-17c838bc6da9ff7defb2a8d5ff539ec743acc1fc.tar.bz2
busybox-w32-17c838bc6da9ff7defb2a8d5ff539ec743acc1fc.zip
patch: add longopts, --dry-run, add one more test
function old new delta patch_main 1110 1214 +104 static.patch_longopts - 47 +47 packed_usage 26738 26761 +23 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 174/0) Total: 174 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite/patch.tests')
-rwxr-xr-xtestsuite/patch.tests47
1 files changed, 41 insertions, 6 deletions
diff --git a/testsuite/patch.tests b/testsuite/patch.tests
index cfe69b76a..178048d2a 100755
--- a/testsuite/patch.tests
+++ b/testsuite/patch.tests
@@ -7,7 +7,7 @@
7# testing "test name" "options" "expected result" "file input" "stdin" 7# testing "test name" "options" "expected result" "file input" "stdin"
8 8
9testing "patch with old_file == new_file" \ 9testing "patch with old_file == new_file" \
10 "patch; echo $?; cat input" \ 10 'patch; echo $?; cat input' \
11"\ 11"\
12patching file input 12patching file input
130 130
@@ -15,7 +15,10 @@ qwe
15asd 15asd
16zxc 16zxc
17" \ 17" \
18 "qwe\nzxc\n" \ 18"\
19qwe
20zxc
21" \
19"\ 22"\
20--- input Jan 01 01:01:01 2000 23--- input Jan 01 01:01:01 2000
21+++ input Jan 01 01:01:01 2000 24+++ input Jan 01 01:01:01 2000
@@ -26,7 +29,7 @@ zxc
26" \ 29" \
27 30
28testing "patch with nonexistent old_file" \ 31testing "patch with nonexistent old_file" \
29 "patch; echo $?; cat input" \ 32 'patch; echo $?; cat input' \
30"\ 33"\
31patching file input 34patching file input
320 350
@@ -34,7 +37,10 @@ qwe
34asd 37asd
35zxc 38zxc
36" \ 39" \
37 "qwe\nzxc\n" \ 40"\
41qwe
42zxc
43" \
38"\ 44"\
39--- input.doesnt_exist Jan 01 01:01:01 2000 45--- input.doesnt_exist Jan 01 01:01:01 2000
40+++ input Jan 01 01:01:01 2000 46+++ input Jan 01 01:01:01 2000
@@ -45,14 +51,18 @@ zxc
45" \ 51" \
46 52
47testing "patch -R with nonexistent old_file" \ 53testing "patch -R with nonexistent old_file" \
48 "patch -R; echo $?; cat input" \ 54 'patch -R; echo $?; cat input' \
49"\ 55"\
50patching file input 56patching file input
510 570
52qwe 58qwe
53zxc 59zxc
54" \ 60" \
55 "qwe\nasd\nzxc\n" \ 61"\
62qwe
63asd
64zxc
65" \
56"\ 66"\
57--- input.doesnt_exist Jan 01 01:01:01 2000 67--- input.doesnt_exist Jan 01 01:01:01 2000
58+++ input Jan 01 01:01:01 2000 68+++ input Jan 01 01:01:01 2000
@@ -62,4 +72,29 @@ zxc
62 zxc 72 zxc
63" \ 73" \
64 74
75testing "patch detects already applied hunk" \
76 'patch 2>&1; echo $?; cat input' \
77"\
78patching file input
79patch: hunk #1 FAILED at 1
80patch: 1 out of 1 hunk FAILED
811
82abc
83def
84123
85" \
86"\
87abc
88def
89123
90" \
91"\
92--- input.old Jan 01 01:01:01 2000
93+++ input Jan 01 01:01:01 2000
94@@ -1,2 +1,3 @@
95 abc
96+def
97 123
98" \
99
65exit $FAILCOUNT 100exit $FAILCOUNT