aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-07-31 22:06:18 -0700
committerJade Lovelace <lix@jade.fyi>2024-08-04 20:41:19 -0700
commit5f0ef50077002f0308fc45f7d0a01a508c970516 (patch)
treea0aecc6edf4298d0f168da350eccab2cbb716391 /tests
parent378ec5fb0611e314511a7afc806664205846fc2e (diff)
cli: eat terminal codes from stdout also
This *should* be sound, plus or minus the amount that the terminal code eating code is messed up already. This is useful for testing CLI output because it will strip the escapes enough to just shove the expected output in a file. Change-Id: I8a9b58fafb918466ac76e9ab585fc32fb9294819
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/search.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/functional/search.sh b/tests/functional/search.sh
index d9c7a75da..1a2a20089 100644
--- a/tests/functional/search.sh
+++ b/tests/functional/search.sh
@@ -29,6 +29,8 @@ nix search -f search.nix '' ^ | grepQuiet hello
## Tests for multiple regex/match highlighting
+# FIXME: possibly not test this with colour in the future
+export CLICOLOR_FORCE=1
e=$'\x1b' # grep doesn't support \e, \033 or even \x1b
# Multiple overlapping regexes
(( $(nix search -f search.nix '' 'oo' 'foo' 'oo' | grep -c "$e\[32;1mfoo$e\\[0;1m") == 1 ))