From f0b7d322d1e29e088708d959ee412b7781630184 Mon Sep 17 00:00:00 2001 From: Simone Ragusa Date: Sat, 21 Sep 2024 22:08:46 +0200 Subject: [PATCH] dircolors: patch test fixture to include alacritty support --- src/uu/dircolors/README.md | 8 +++++++- src/uu/dircolors/alacritty-supports-colors.patch | 12 ++++++++++++ tests/fixtures/dircolors/internal.expected | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/uu/dircolors/alacritty-supports-colors.patch diff --git a/src/uu/dircolors/README.md b/src/uu/dircolors/README.md index ce8aa965f..f4ec5d675 100644 --- a/src/uu/dircolors/README.md +++ b/src/uu/dircolors/README.md @@ -9,10 +9,16 @@ dircolors -b > /PATH_TO_COREUTILS/tests/fixtures/dircolors/bash_def.expected dircolors -c > /PATH_TO_COREUTILS/tests/fixtures/dircolors/csh_def.expected ``` +Apply the patches to include more terminals that support colors: + +```shell +git apply /PATH_TO_COREUTILS/src/uu/dircolors/alacritty-supports-colors.patch +``` + Run the tests: ```shell cargo test --features "dircolors" --no-default-features ``` -Edit `/PATH_TO_COREUTILS/src/uu/dircolors/src/colors.rs` until the tests pass. +Edit `/PATH_TO_COREUTILS/src/uu/dircolors/src/dircolors.rs` until the tests pass. diff --git a/src/uu/dircolors/alacritty-supports-colors.patch b/src/uu/dircolors/alacritty-supports-colors.patch new file mode 100644 index 000000000..c6f022423 --- /dev/null +++ b/src/uu/dircolors/alacritty-supports-colors.patch @@ -0,0 +1,12 @@ +diff --git a/tests/fixtures/dircolors/internal.expected b/tests/fixtures/dircolors/internal.expected +index e151973f2..01dae4273 100644 +--- a/tests/fixtures/dircolors/internal.expected ++++ b/tests/fixtures/dircolors/internal.expected +@@ -7,6 +7,7 @@ + # restrict following config to systems with matching environment variables. + COLORTERM ?* + TERM Eterm ++TERM alacritty* + TERM ansi + TERM *color* + TERM con[0-9]*x[0-9]* diff --git a/tests/fixtures/dircolors/internal.expected b/tests/fixtures/dircolors/internal.expected index e151973f2..01dae4273 100644 --- a/tests/fixtures/dircolors/internal.expected +++ b/tests/fixtures/dircolors/internal.expected @@ -7,6 +7,7 @@ # restrict following config to systems with matching environment variables. COLORTERM ?* TERM Eterm +TERM alacritty* TERM ansi TERM *color* TERM con[0-9]*x[0-9]*