[git commit master 1/1] add a test for patch which we currently fail

Denys Vlasenko vda.linux at googlemail.com
Sun Nov 28 00:41:40 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=fe9403ad17d6cac5984fcb9b9e18ed755898afff
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 testsuite/patch.tests |   37 +++++++++++++++++++++++++++++++++++++
 testsuite/testing.sh  |    1 +
 2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/testsuite/patch.tests b/testsuite/patch.tests
index ba37e82..c604b9c 100755
--- a/testsuite/patch.tests
+++ b/testsuite/patch.tests
@@ -175,6 +175,43 @@ abc
  123
 " \
 
+# testing "test name" "command(s)" "expected result" "file input" "stdin"
+testing "patch at the beginning" \
+	'patch 2>&1; cat input' \
+"\
+patching file input
+111changed
+444
+555
+666
+777
+888
+999
+" \
+"\
+111
+222
+333
+444
+555
+666
+777
+888
+999
+" \
+"\
+--- input
++++ input
+@@ -1,6 +1,4 @@
+-111
+-222
+-333
++111changed
+ 444
+ 555
+ 666
+" \
+
 rm input.orig 2>/dev/null
 
 exit $FAILCOUNT
diff --git a/testsuite/testing.sh b/testsuite/testing.sh
index c7c9ca6..e7e64e5 100644
--- a/testsuite/testing.sh
+++ b/testsuite/testing.sh
@@ -87,6 +87,7 @@ testing()
 
   $ECHO -ne "$3" > expected
   $ECHO -ne "$4" > input
+  [ -z "$VERBOSE" ] || echo ======================
   [ -z "$VERBOSE" ] || echo "echo -ne '$4' >input"
   [ -z "$VERBOSE" ] || echo "echo -ne '$5' | $2"
   $ECHO -ne "$5" | eval "$2" > actual
-- 
1.7.2.2



More information about the busybox-cvs mailing list