diff options
author | Fishhh <hubert.gluchowski19@gmail.com> | 2022-06-05 19:44:42 +0200 |
---|---|---|
committer | Hubert GÅ‚uchowski <hubert.gluchowski19@gmail.com> | 2022-06-07 18:25:52 +0200 |
commit | 0338cf55395feb3aedabc535858263d95d235f72 (patch) | |
tree | 50c07bd4e57b88a4091910f173edde7bc60172e2 /tests | |
parent | e009367c8d4523bfe3a1bc20583b27d06948a390 (diff) |
Add tests for `--exclude` flag in `nix search`
Diffstat (limited to 'tests')
-rw-r--r-- | tests/search.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/search.sh b/tests/search.sh index 52e12f381..f320e0ec1 100644 --- a/tests/search.sh +++ b/tests/search.sh @@ -36,3 +36,9 @@ e=$'\x1b' # grep doesn't support \e, \033 or even \x1b (( $(nix search -f search.nix '' 'o' | grep -Eo "$e\[32;1mo{1,2}$e\[(0|0;1)m" | wc -l) == 3 )) # Searching for 'b' should yield the 'b' in bar and the two 'b's in 'broken bar' (( $(nix search -f search.nix '' 'b' | grep -Eo "$e\[32;1mb$e\[(0|0;1)m" | wc -l) == 3 )) + +## Tests for --exclude +(( $(nix search -f search.nix -e hello | grep -c hello) == 0 )) + +(( $(nix search -f search.nix foo --exclude 'foo|bar' | grep -Ec 'foo|bar') == 0 )) +(( $(nix search -f search.nix foo -e foo --exclude bar | grep -Ec 'foo|bar') == 0 )) |