Blame grep-2.22-test-pcre-count-fix.patch

f1be6b
diff --git a/tests/pcre-count b/tests/pcre-count
f1be6b
--- a/tests/pcre-count
f1be6b
+++ b/tests/pcre-count
f1be6b
@@ -13,11 +13,17 @@ require_pcre_
f1be6b
 
f1be6b
 fail=0
f1be6b
 
f1be6b
-printf 'a\n%032768d\nb\x0\n%032768d\na\n' 0 0 > in
f1be6b
+printf 'a\n%032768d\nb\0\n%032768d\na\n' 0 0 > in || framework_failure_
f1be6b
 
f1be6b
-LC_ALL=C grep -P 'a' in | wc -l > exp
f1be6b
+# grep will discover that the input is a binary file sooner if the
f1be6b
+# page size is larger, so allow for either possible output.
f1be6b
+printf 'a\nBinary file in matches\n' >exp1a || framework_failure_
f1be6b
+printf 'Binary file in matches\n' >exp1b || framework_failure_
f1be6b
+LC_ALL=C grep -P 'a' in >out || fail=1
f1be6b
+compare exp1a out || compare exp1b out || fail=1
f1be6b
 
f1be6b
-LC_ALL=C grep -Pc 'a' in > out ||  fail=1
f1be6b
-compare exp out || fail=1
f1be6b
+printf '2\n' >exp2 || framework_failure_
f1be6b
+LC_ALL=C grep -Pc 'a' in >out || fail=1
f1be6b
+compare exp2 out || fail=1
f1be6b
 
f1be6b
 Exit $fail
f1be6b