X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=tests%2Finit.cfg;h=27515c5ad655d4819a70ae068a802e43b38f5b9a;hb=63a4dabcae87d368cccb3365f2266b8941ba8915;hp=5adfc9b357a134dcadd90de07838a535f84739fa;hpb=4ee107046a0ffd91f6c60c787326a5e27b799f6d;p=debian%2Fgzip diff --git a/tests/init.cfg b/tests/init.cfg index 5adfc9b..27515c5 100644 --- a/tests/init.cfg +++ b/tests/init.cfg @@ -4,17 +4,12 @@ # TESTS_ENVIRONMENT definition. stderr_fileno_=9 -require_POSIX_grep_() +# Like printf with a single argument, but that argument must be a +# sequence of four-byte strings \xHH where each H is a hexadecimal byte. +hex_printf_() { - # Ensure that grep's -f and -E options works. - # On Solaris 5.11, "grep -f" prints this: - # grep: illegal option -- f - # Usage: grep -hblcnsviw pattern file . . . - # Similar for grep -E. - - : | grep -f /dev/null - test $? = 1 || skip_ 'your grep lacks support for -f -' - - grep -E foo /dev/null - test $? = 1 || skip_ 'your grep lacks support for -E' + local octal_fmt=$(printf '\\%o' \ + $(printf '%s\n' "$1" \ + | sed 's,\\x\([0-9abcdefABCDEF][0-9abcdefABCDEF]\), 0x\1,g')) + printf "$octal_fmt" }