2018-02-26 00:33:17 +02:00
|
|
|
source common.sh
|
|
|
|
|
|
|
|
clearStore
|
|
|
|
clearCache
|
|
|
|
|
2020-04-20 16:27:09 +03:00
|
|
|
(( $(nix search -f search.nix '' hello | wc -l) > 0 ))
|
2018-02-26 00:33:17 +02:00
|
|
|
|
|
|
|
# Check descriptions are searched
|
2020-04-20 16:27:09 +03:00
|
|
|
(( $(nix search -f search.nix '' broken | wc -l) > 0 ))
|
2018-02-26 00:33:17 +02:00
|
|
|
|
|
|
|
# Check search that matches nothing
|
2020-04-20 16:27:09 +03:00
|
|
|
(( $(nix search -f search.nix '' nosuchpackageexists | wc -l) == 0 ))
|
2018-02-26 00:33:17 +02:00
|
|
|
|
2018-04-18 22:45:46 +03:00
|
|
|
# Search for multiple arguments
|
2020-04-20 16:27:09 +03:00
|
|
|
(( $(nix search -f search.nix '' hello empty | wc -l) == 2 ))
|
2018-04-18 22:45:46 +03:00
|
|
|
|
|
|
|
# Multiple arguments will not exist
|
2020-04-20 16:27:09 +03:00
|
|
|
(( $(nix search -f search.nix '' hello broken | wc -l) == 0 ))
|
2018-02-26 00:33:17 +02:00
|
|
|
|
|
|
|
## Search expressions
|
|
|
|
|
|
|
|
# Check that empty search string matches all
|
2020-04-20 16:27:09 +03:00
|
|
|
nix search -f search.nix '' |grep -q foo
|
|
|
|
nix search -f search.nix '' |grep -q bar
|
|
|
|
nix search -f search.nix '' |grep -q hello
|