summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2014-11-07 08:30:31 -0800
committerJim Meyering <meyering@fb.com>2014-11-07 08:31:59 -0800
commit95dea21fcaa62d8d5efb2afe9d7c1afcd5ec496f (patch)
tree174c5210afa5fbdd21dd82dddaf6ba552316ab13
parent74c1f309e35d456c48efed5d2193df4f66b67272 (diff)
downloadgrep-95dea21fcaa62d8d5efb2afe9d7c1afcd5ec496f.tar.gz
maint: move helper function, hex_printf to init.cfg
* tests/init.cfg (hex_printf_): New function, from ... * tests/multibyte-white-space: ... here. Reflect the s/hex_print/hex_printf_/ renaming.
-rw-r--r--tests/init.cfg8
-rwxr-xr-xtests/multibyte-white-space12
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/init.cfg b/tests/init.cfg
index 882feb1c..9342d3d6 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -154,3 +154,11 @@ or use the shortcut target of the toplevel Makefile,
'
fi
}
+
+# Like printf with a single argument.
+# The difference is that while some printf implementations fail to
+# handle \xHH escapes, no awk implementation has that problem.
+hex_printf_()
+{
+ ${AWK-awk} 'BEGIN { printf "'"$1"'" }' </dev/null
+}
diff --git a/tests/multibyte-white-space b/tests/multibyte-white-space
index 58166431..bb1bdaf6 100755
--- a/tests/multibyte-white-space
+++ b/tests/multibyte-white-space
@@ -57,18 +57,10 @@ EOF
fail=0
-# Like printf with a single argument.
-# The difference is that while some printf implementations fail to
-# handle \xHH escapes, no awk implementation has that problem.
-hex_printf()
-{
- ${AWK-awk} 'BEGIN { printf "'"$1"'" }' </dev/null
-}
-
for i in $utf8_space_characters; do
- hex_printf "$i\n" | grep -q '^\s$' \
+ hex_printf_ "$i\n" | grep -q '^\s$' \
|| { warn_ "$i FAILED to match \\s"; fail=1; }
- hex_printf "$i\n" | grep -q '\S'
+ hex_printf_ "$i\n" | grep -q '\S'
test $? = 1 \
|| { warn_ "$i vs. \\S FAILED"; fail=1; }
done