summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-02-24 14:06:05 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-02-24 14:28:17 -0500
commitb490dc534eedcc9878d4962e6d02baf4217a712f (patch)
tree708d96ae84732441bfa4b2e40d48e141e691f8a3 /tests.sh
parent0633154419955e35470b38aafd49b6f52510333a (diff)
downloadbfs-b490dc534eedcc9878d4962e6d02baf4217a712f.tar.xz
regex: Use the encoding from the current locale
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests.sh b/tests.sh
index d7d9947..9003efd 100755
--- a/tests.sh
+++ b/tests.sh
@@ -625,6 +625,7 @@ gnu_tests=(
test_regex
test_regex_parens
test_regex_error
+ test_regex_invalid_utf8
test_regextype_posix_basic
test_regextype_posix_extended
@@ -2146,6 +2147,17 @@ function test_regex_error() {
fail quiet invoke_bfs basic -regex '['
}
+function test_regex_invalid_utf8() {
+ rm -rf scratch/*
+
+ # Incomplete UTF-8 sequences
+ skip_if fail quiet touch scratch/$'\xC3'
+ skip_if fail quiet touch scratch/$'\xE2\x84'
+ skip_if fail quiet touch scratch/$'\xF0\x9F\x92'
+
+ bfs_diff scratch -regex 'scratch/..'
+}
+
function test_E() {
cd weirdnames
bfs_diff -E . -regex '\./(\()'