lix/tests/search.sh

26 lines
683 B
Bash
Raw Normal View History

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