aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtestsuite/patch.tests37
-rw-r--r--testsuite/testing.sh1
2 files changed, 38 insertions, 0 deletions
diff --git a/testsuite/patch.tests b/testsuite/patch.tests
index ba37e8218..c604b9c1d 100755
--- a/testsuite/patch.tests
+++ b/testsuite/patch.tests
@@ -175,6 +175,43 @@ abc
175 123 175 123
176" \ 176" \
177 177
178# testing "test name" "command(s)" "expected result" "file input" "stdin"
179testing "patch at the beginning" \
180 'patch 2>&1; cat input' \
181"\
182patching file input
183111changed
184444
185555
186666
187777
188888
189999
190" \
191"\
192111
193222
194333
195444
196555
197666
198777
199888
200999
201" \
202"\
203--- input
204+++ input
205@@ -1,6 +1,4 @@
206-111
207-222
208-333
209+111changed
210 444
211 555
212 666
213" \
214
178rm input.orig 2>/dev/null 215rm input.orig 2>/dev/null
179 216
180exit $FAILCOUNT 217exit $FAILCOUNT
diff --git a/testsuite/testing.sh b/testsuite/testing.sh
index c7c9ca6af..e7e64e58b 100644
--- a/testsuite/testing.sh
+++ b/testsuite/testing.sh
@@ -87,6 +87,7 @@ testing()
87 87
88 $ECHO -ne "$3" > expected 88 $ECHO -ne "$3" > expected
89 $ECHO -ne "$4" > input 89 $ECHO -ne "$4" > input
90 [ -z "$VERBOSE" ] || echo ======================
90 [ -z "$VERBOSE" ] || echo "echo -ne '$4' >input" 91 [ -z "$VERBOSE" ] || echo "echo -ne '$4' >input"
91 [ -z "$VERBOSE" ] || echo "echo -ne '$5' | $2" 92 [ -z "$VERBOSE" ] || echo "echo -ne '$5' | $2"
92 $ECHO -ne "$5" | eval "$2" > actual 93 $ECHO -ne "$5" | eval "$2" > actual