diff.tests: add testcases for -B and single line changes
authorAaro Koskinen <aaro.koskinen@iki.fi>
Thu, 30 Jul 2015 20:13:26 +0000 (23:13 +0300)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 31 Jul 2015 14:51:15 +0000 (16:51 +0200)
Add testcases for -B and single line changes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
testsuite/diff.tests

index 84d853852002541881ae4f8bc0006a06550d975e..0ced0f248fed2f46a371e591c7ec6e5f2a3cb481 100755 (executable)
@@ -98,6 +98,18 @@ testing "diff -B does not ignore changes whose lines are not all blank" \
        "a\n" \
        "\nb\n\n"
 
+testing "diff -B ignores blank single line change" \
+       'diff -qB - input; echo $?' \
+       "0\n" \
+       "\n1\n" \
+       "1\n"
+
+testing "diff -B does not ignore non-blank single line change" \
+       'diff -qB - input; echo $?' \
+       "Files - and input differ\n1\n" \
+       "0\n" \
+       "1\n"
+
 testing "diff always takes context from old file" \
        "diff -ub - input | $TRIM_TAB" \
 "\