From b490dc534eedcc9878d4962e6d02baf4217a712f Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 24 Feb 2022 14:06:05 -0500 Subject: regex: Use the encoding from the current locale --- tests.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests.sh') 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 '\./(\()' -- cgit v1.2.3