tests: dircolors: check TERM filtering of the built-in database

* tests/misc/dircolors.pl (builtin-no-term, builtin-unknown-term)
(builtin-unknown-term-ls): New tests, ensuring the built-in database
is filtered by TERM and COLORTERM, like a user-supplied one.

https://github.com/uutils/coreutils/pull/14408

Link: https://github.com/coreutils/coreutils/pull/460
This commit is contained in:
Sylvestre Ledru authored and Pádraig Brady committed 2026-11-15 15:59:16 +00:00
1 parent 994f0f0983
commit dc159f5fa0
1 file changed
+9
+9
View File
@@ -52,6 +52,15 @@ my @Tests =
{IN => "COLORTERM ?*\nowt 40;33\n"},
{OUT => "LS_COLORS='';\nexport LS_COLORS\n"}],
# The built-in database is filtered by TERM and COLORTERM too.
['builtin-no-term', '-b', {ENV => 'COLORTERM='},
{OUT => "LS_COLORS='';\nexport LS_COLORS\n"}],
['builtin-unknown-term', '-c',
{ENV => 'TERM=no-such-terminal COLORTERM='},
{OUT => "setenv LS_COLORS ''\n"}],
['builtin-unknown-term-ls', '--print-ls-colors',
{ENV => 'TERM=no-such-terminal COLORTERM='}, {OUT => ""}],
['print-clash1', '-p', '--print-ls',
{ERR => "dircolors: options --print-database and --print-ls-colors " .
"are mutually exclusive\n" .