Skip to content

tests: ls: add quoting-utf8 test for Unicode quotes in UTF-8 locales#243

Closed
sylvestre wants to merge 1 commit intocoreutils:masterfrom
sylvestre:quoting-utf8
Closed

tests: ls: add quoting-utf8 test for Unicode quotes in UTF-8 locales#243
sylvestre wants to merge 1 commit intocoreutils:masterfrom
sylvestre:quoting-utf8

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

  • tests/ls/quoting-utf8.sh: New test verifying that --quoting-style=locale and --quoting-style=clocale use Unicode left/right single quotation marks in UTF-8 locales, and that embedded apostrophes and double quotes are not escaped when the delimiters are different characters. Also checks C locale fallback to ASCII quotes.
  • tests/local.mk: Add new test to the list.

* tests/ls/quoting-utf8.sh: New test verifying that
--quoting-style=locale and --quoting-style=clocale use Unicode
left/right single quotation marks in UTF-8 locales, and that
embedded apostrophes and double quotes are not escaped when the
delimiters are different characters. Also checks C locale fallback
to ASCII quotes.
* tests/local.mk: Add new test to the list.
. "${srcdir=.}/tests/init.sh";
print_ver_ ls

locale -a 2>/dev/null | grep -qi 'en_US\.utf' || skip_ "en_US.UTF-8 locale not available"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's inefficient. I'll adjust to the way we usually check this:

test "$(LC_ALL=en_US.UTF-8 locale charmap 2>/dev/null)" = UTF-8 ||
  skip_ 'en_US.UTF-8 locale not available'

@pixelb
Copy link
Copy Markdown
Member

pixelb commented Apr 6, 2026

Pushed in 3a9901daa

@pixelb pixelb closed this Apr 6, 2026
hubot pushed a commit that referenced this pull request Apr 6, 2026
* tests/ls/quoting-utf8.sh: New test verifying that
--quoting-style=locale and --quoting-style=clocale use Unicode
left/right single quotation marks in UTF-8 locales, and that
embedded apostrophes and double quotes are not escaped when the
delimiters are different characters.
Also check C locale fallback to ASCII quotes.
* tests/local.mk: Reference the new test.
#243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants