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