aurutils: v18.4
[aurutils.git] / tests / query
blob28153f1a95eb6c56f46e51c9a5695fae6342bd33
1 #!/bin/bash
3 # random position of stdin marker
4 cnt=$(aur query -t info aurutils aurutils-git - </dev/null | jq .resultcount)
5 (( cnt == 2 )) || exit
6 cnt=$(aur query -t info aurutils - aurutils-git </dev/null | jq .resultcount)
7 (( cnt == 2 )) || exit
8 cnt=$(aur query -t info - aurutils aurutils-git </dev/null | jq .resultcount)
9 (( cnt == 2 )) || exit
11 # concatenation of stdin and command-line arguments
12 cnt=$(aur query -t info aurutils - <<< 'aurutils-git' | jq .resultcount)
13 (( cnt == 2 )) || exit
15 # multiple stdin markers
16 cnt=$(aur query -t info - - aurutils </dev/null | jq .resultcount)
17 (( cnt == 1 )) || exit
18 cnt=$(aur query -t info - aurutils - </dev/null | jq .resultcount)
19 (( cnt == 1 )) || exit
20 cnt=$(aur query -t info aurutils - - </dev/null | jq .resultcount)
21 (( cnt == 1 )) || exit
23 # type is mandatory
24 aur query aurutils
25 (( $? == 1 )) || exit
27 # no arguments specified
28 aur query -t info
29 (( $? == 1 )) || exit
30 aur query -t info - </dev/null
31 (( $? == 0 )) || exit