1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

dircolors: patch test fixture to include alacritty support

This commit is contained in:
Simone Ragusa 2024-09-21 22:08:46 +02:00 committed by Sylvestre Ledru
parent 4f422c1a3a
commit f0b7d322d1
3 changed files with 20 additions and 1 deletions

View file

@ -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.

View file

@ -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]*

View file

@ -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]*