mirror of
https://github.com/coreutils/coreutils.git
synced 2026-10-28 09:44:34 +08:00
maint: tests: refactor uses of bad_unicode()
* init.cfg: Use 0xFF rather than 0xC3 everywhere. * tests/fold/fold-characters.sh: Reuse bad_unicode(). * tests/tac/tac-locale.sh: Likewise.
This commit is contained in:
1 parent
a85e9182b1
commit
e24372e6d0
3 files changed
+3
-9
No files matched your search
@@ -837,7 +837,7 @@ bad_unicode ()
|
||||
require_built_ printf
|
||||
|
||||
# invalid UTF8|unpaired surrogate|C1 control|noncharacter
|
||||
env printf '\xC3|\xED\xBA\xAD|\u0089|\xED\xA6\xBF\xED\xBF\xBF\n'
|
||||
env printf '\xFF|\xED\xBA\xAD|\u0089|\xED\xA6\xBF\xED\xBF\xBF\n'
|
||||
}
|
||||
|
||||
# AIX has a 'strace' program unrelated to the one we care about. Avoid
|
||||
|
||||
@@ -83,12 +83,7 @@ env printf '\naaaa\n' >> exp3 || framework_failure_
|
||||
fold --characters input3 | tail -n 4 > out3 || fail=1
|
||||
compare exp3 out3 || fail=1
|
||||
|
||||
# Sequence derived from <https://datatracker.ietf.org/doc/rfc9839>.
|
||||
bad_unicode_with_nul ()
|
||||
{
|
||||
# invalid UTF8|unpaired surrogate|NUL|C1 control|noncharacter
|
||||
env printf '\xFF|\xED\xBA\xAD|\u0000|\u0089|\xED\xA6\xBF\xED\xBF\xBF\n'
|
||||
}
|
||||
bad_unicode_with_nul () { env printf '%s|\u0000\n' "$(bad_unicode)"; }
|
||||
bad_unicode_with_nul > exp4 || framework_failure_
|
||||
bad_unicode_with_nul | fold > out4 || fail=1
|
||||
compare exp4 out4 || fail=1
|
||||
|
||||
@@ -38,8 +38,7 @@ export LC_ALL=$LOCALE_FR_UTF8
|
||||
if test "$(locale charmap 2>/dev/null)" = UTF-8; then
|
||||
check_separator '\u0434' # д
|
||||
check_separator '\u0434\u0436' # дж
|
||||
# invalid UTF8|unpaired surrogate|C1 control|noncharacter
|
||||
check_separator '\xC3|\xED\xBA\xAD|\u0089|\xED\xA6\xBF\xED\xBF\xBF'
|
||||
check_separator "$(bad_unicode)"
|
||||
fi
|
||||
|
||||
Exit $fail
|
||||
Reference in new issue
Block a user