summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>2023-01-06 20:40:07 -0800
committerJim Meyering <meyering@meta.com>2023-01-11 10:24:09 -0800
commit8f6a1e90e4f14390ef2171aa37a1866f90292914 (patch)
tree064339efea3f71ab2b67bb7dd33de4f604501621 /tests
parent5e3b760f65f13856e5717e5b9d935f5b4a615be3 (diff)
downloadgrep-8f6a1e90e4f14390ef2171aa37a1866f90292914.tar.gz
pcre: use UTF only when available in the library
Before this change, if linked with a PCRE library without unicode any invocations of grep when using a UTF locale will error with: grep: this version of PCRE2 does not have Unicode support * src/pcresearch.c: Check whether Unicode was compiled in. * tests/pcre-utf8-w: Add check to skip test. * tests/pcre-utf8: Update check.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/pcre-utf82
-rwxr-xr-xtests/pcre-utf8-w5
2 files changed, 5 insertions, 2 deletions
diff --git a/tests/pcre-utf8 b/tests/pcre-utf8
index 1b3b2d3b..4d97e69c 100755
--- a/tests/pcre-utf8
+++ b/tests/pcre-utf8
@@ -14,7 +14,7 @@ LC_ALL=en_US.UTF-8 require_pcre_
fail=0
echo '$' | LC_ALL=en_US.UTF-8 grep -qP '\p{S}' \
- || skip_ 'PCRE support is compiled out, or it does not support properties'
+ || skip_ 'PCRE unicode support is compiled out'
euro='\342\202\254 euro'
printf "$euro\\n" > in || framework_failure_
diff --git a/tests/pcre-utf8-w b/tests/pcre-utf8-w
index 4cd7db69..81ac9ff8 100755
--- a/tests/pcre-utf8-w
+++ b/tests/pcre-utf8-w
@@ -13,9 +13,12 @@ LC_ALL=en_US.UTF-8
export LC_ALL
require_pcre_
+echo . | grep -qP '(*UTF).' 2>/dev/null \
+ || skip_ 'PCRE unicode support is compiled out'
+
fail=0
-echo 'Perú'> in || framework_failure_
+echo 'Perú' > in || framework_failure_
echo 'ú' > exp || framework_failure_
grep -Po '.\b' in > out || fail=1