diff options
author | Pádraig Brady <P@draigBrady.com> | 2022-10-27 15:17:07 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2022-10-28 13:45:27 +0100 |
commit | 0925e8a0f413ecf9004153d89b312b385b20d0ee (patch) | |
tree | 770853d22dd1be85c038ce280399ff16d80e8328 /tests | |
parent | 468c4fb10d08c54823a42f7aa0d7fe7e9552b2c3 (diff) | |
download | coreutils-0925e8a0f413ecf9004153d89b312b385b20d0ee.tar.gz |
printf: with \U, support all valid unicode points
Previously this was restricted to the C99 universal character subset,
which restricted most values <= 0x9F, as that simplifies the C lexer.
However printf(1) doesn't need this restriction.
Note also the bash builtin printf already supports all values <= 0x9F.
* src/printf.c (main): Relax the restriction on points <= 0x9F.
* doc/coreutils.texi (printf invocation): Adjust description.
* tests/misc/printf-cov.pl: Adjust accordingly. Add new cases.
* NEWS: Mention the change in behavior.
Reported at https://bugs.debian.org/1022857
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/misc/printf-cov.pl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/misc/printf-cov.pl b/tests/misc/printf-cov.pl index ab6bd159b..59c85cb66 100755 --- a/tests/misc/printf-cov.pl +++ b/tests/misc/printf-cov.pl @@ -66,9 +66,14 @@ my @Tests = ['esc', q('\xaa\0377'), {OUT=>"\xaa\0377"}], ['esc-bad-hex', q('\x'), {EXIT=>1}, {ERR=>"$prog: missing hexadecimal number in escape\n"}], - # ['u4', q('\u09ac'), {OUT=>"\xe0a6ac"}], - ['u-invalid', q('\u0000'), {EXIT=>1}, - {ERR=>"$prog: invalid universal character name \\u0000\n"}], + ['u-bad-hex', q('\u00'), {EXIT=>1}, + {ERR=>"$prog: missing hexadecimal number in escape\n"}], + ['U-bad-hex', q('\U0000'), {EXIT=>1}, + {ERR=>"$prog: missing hexadecimal number in escape\n"}], + ['u4', q('\u0030'), {OUT=>"0"}], + ['U8', q('\U00000030'), {OUT=>"0"}], + ['u-invalid', q('\ud800'), {EXIT=>1}, + {ERR=>"$prog: invalid universal character name \\ud800\n"}], ['u-missing', q('\u'), {EXIT=>1}, {ERR=>"$prog: missing hexadecimal number in escape\n"}], ['d-invalid', '%d no-num', {OUT=>'0'}, {EXIT=>1}, |