From: Sylvestre Ledru <[email protected]>

* 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" .
-- 
2.56.0


Reply via email to