. ./testing.sh
-# testing "test name" "options" "expected result" "file input" "stdin"
+# testing "test name" "command(s)" "expected result" "file input" "stdin"
testing "patch with old_file == new_file" \
'patch 2>&1; echo $?; cat input' \
+456
" \
+# testing "test name" "command(s)" "expected result" "file input" "stdin"
+
+testing "patch -N ignores already applied hunk" \
+ 'patch -N 2>&1; echo $?; cat input' \
+"\
+patching file input
+0
+abc
+def
+123
+" \
+"\
+abc
+def
+123
+" \
+"\
+--- input
++++ input
+@@ -1,2 +1,3 @@
+ abc
++def
+ 123
+" \
+
rm input.orig 2>/dev/null
exit $FAILCOUNT