From dc159f5fa05b93d031b2197d625c9cee753b090a Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 15 Nov 2026 16:40:30 +0100 Subject: [PATCH] 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 --- tests/misc/dircolors.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/misc/dircolors.pl b/tests/misc/dircolors.pl index 6c0575c43..d58d9dd22 100755 --- a/tests/misc/dircolors.pl +++ b/tests/misc/dircolors.pl @@ -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" .