add a test for patch which we currently fail
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 28 Nov 2010 00:41:40 +0000 (01:41 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 28 Nov 2010 00:41:40 +0000 (01:41 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
testsuite/patch.tests
testsuite/testing.sh

index ba37e821897cbd347ed041bd760f8c54e2487e9f..c604b9c1d88468e8842e390765377811eab7b939 100755 (executable)
@@ -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
index c7c9ca6afc75fbc78cee660b9f0ab24c2e582067..e7e64e58b6a559d5be312964a1283d8c78e79d0f 100644 (file)
@@ -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