aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-03-25 14:15:39 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-03-25 14:15:39 +0000
commitcc2965fd236a85e5cac4fffa1c34057997780385 (patch)
tree39c5b7183cbc85130bd3f43ae25bd84898463c22 /testsuite
parent80591b0a000e88c284bd2ec355f27e19e1da7528 (diff)
downloadbusybox-w32-cc2965fd236a85e5cac4fffa1c34057997780385.tar.gz
busybox-w32-cc2965fd236a85e5cac4fffa1c34057997780385.tar.bz2
busybox-w32-cc2965fd236a85e5cac4fffa1c34057997780385.zip
patch: fix vda's thinko: we need to open new_filename.orig, always!
plug memory leak; add testsuite patch_main 1009 988 -21
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/patch.tests47
1 files changed, 47 insertions, 0 deletions
diff --git a/testsuite/patch.tests b/testsuite/patch.tests
new file mode 100755
index 000000000..8a957d3f7
--- /dev/null
+++ b/testsuite/patch.tests
@@ -0,0 +1,47 @@
1#!/bin/sh
2# Copyright 2008 by Denys Vlasenko
3# Licensed under GPL v2, see file LICENSE for details.
4
5. testing.sh
6
7# testing "test name" "options" "expected result" "file input" "stdin"
8
9testing "patch with old_file == new_file" \
10 "patch; echo $?; cat input" \
11"\
12patching file input
130
14qwe
15asd
16zxc
17" \
18 "qwe\nzxc\n" \
19"\
20--- input Jan 01 01:01:01 2000
21+++ input Jan 01 01:01:01 2000
22@@ -1,2 +1,3 @@
23 qwe
24+asd
25 zxc
26" \
27
28testing "patch with nonexistent old_file" \
29 "strace -o zzz patch; echo $?; cat input" \
30"\
31patching file input
320
33qwe
34asd
35zxc
36" \
37 "qwe\nzxc\n" \
38"\
39--- input.doesnt_exist Jan 01 01:01:01 2000
40+++ input Jan 01 01:01:01 2000
41@@ -1,2 +1,3 @@
42 qwe
43+asd
44 zxc
45" \
46
47exit $FAILCOUNT