summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRob Landley2010-08-13 15:50:26 +0200
committerDenys Vlasenko2010-08-13 15:50:26 +0200
commit1bbc0cd7f293aac5e15d6c1e16bee9f1484c6fbf (patch)
treea2a5ba8d9508982f80b702a99c2e10d1644ae40e /testsuite
parentdcaed97e0f44d0cd285fb590ec6ec80d0d73e738 (diff)
downloadbusybox-1bbc0cd7f293aac5e15d6c1e16bee9f1484c6fbf.zip
busybox-1bbc0cd7f293aac5e15d6c1e16bee9f1484c6fbf.tar.gz
patch: replace it with toybox's implementation
Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/patch.tests13
-rw-r--r--testsuite/testing.sh3
2 files changed, 10 insertions, 6 deletions
diff --git a/testsuite/patch.tests b/testsuite/patch.tests
index 749d936..6ee795d 100755
--- a/testsuite/patch.tests
+++ b/testsuite/patch.tests
@@ -7,7 +7,7 @@
# testing "test name" "options" "expected result" "file input" "stdin"
testing "patch with old_file == new_file" \
- 'patch; echo $?; cat input' \
+ 'patch 2>&1; echo $?; cat input' \
"\
patching file input
0
@@ -29,7 +29,7 @@ zxc
" \
testing "patch with nonexistent old_file" \
- 'patch; echo $?; cat input' \
+ 'patch 2>&1; echo $?; cat input' \
"\
patching file input
0
@@ -51,7 +51,7 @@ zxc
" \
testing "patch -R with nonexistent old_file" \
- 'patch -R; echo $?; cat input' \
+ 'patch -R 2>&1; echo $?; cat input' \
"\
patching file input
0
@@ -75,9 +75,12 @@ zxc
testing "patch detects already applied hunk" \
'patch 2>&1; echo $?; cat input' \
"\
+Possibly reversed hunk 1 at 2
+Hunk 1 FAILED 1/1.
+ abc
++def
+ 123
patching file input
-patch: hunk #1 FAILED at 1
-patch: 1 out of 1 hunk FAILED
1
abc
def
diff --git a/testsuite/testing.sh b/testsuite/testing.sh
index f907dea..c7c9ca6 100644
--- a/testsuite/testing.sh
+++ b/testsuite/testing.sh
@@ -1,4 +1,4 @@
-# Simple test harness infrastructurei for BusyBox
+# Simple test harness infrastructure for BusyBox
#
# Copyright 2005 by Rob Landley
#
@@ -87,6 +87,7 @@ testing()
$ECHO -ne "$3" > expected
$ECHO -ne "$4" > input
+ [ -z "$VERBOSE" ] || echo "echo -ne '$4' >input"
[ -z "$VERBOSE" ] || echo "echo -ne '$5' | $2"
$ECHO -ne "$5" | eval "$2" > actual
RETVAL=$?