]>
Commit | Line | Data |
---|---|---|
1bef0dd5 MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
1bef0dd5 MV |
6 | |
7 | setupenvironment | |
8 | configarchitecture "i386" | |
9 | ||
01837669 | 10 | DESCR='Some description that has a unusual word xxyyzz and aabbcc and a UPPERCASE' |
1bef0dd5 | 11 | DESCR2='Some other description with the unusual aabbcc only' |
1a68655d DK |
12 | insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR |
13 | Long description of stuff and such, with lines | |
14 | . | |
15 | and paragraphs and everything." | |
1bef0dd5 MV |
16 | insertpackage 'testing' 'bar' 'i386' '2.0' '' '' "$DESCR2" |
17 | ||
18 | setupaptarchive | |
19 | ||
3abb6a6a | 20 | APTARCHIVE="$(readlink -f ./aptarchive)" |
1bef0dd5 | 21 | |
25b86db1 DK |
22 | testfailureequal 'E: You must give at least one search pattern' aptcache search |
23 | testfailureequal 'E: You must give at least one search pattern' apt search | |
081c9d44 | 24 | |
1bef0dd5 | 25 | # with OP progress |
25b86db1 | 26 | testsuccessequal "Sorting... |
1bef0dd5 MV |
27 | Full Text Search... |
28 | foo/unstable 1.0 all | |
29 | $DESCR | |
30 | " apt search xxyyzz | |
31 | ||
32 | # without op progress | |
25b86db1 | 33 | testsuccessequal "foo/unstable 1.0 all |
1bef0dd5 MV |
34 | $DESCR |
35 | " apt search -qq xxyyzz | |
859093da DK |
36 | testempty apt search -qq --names-only xxyyzz |
37 | ||
38 | # search name | |
25b86db1 | 39 | testsuccessequal "foo/unstable 1.0 all |
859093da DK |
40 | $DESCR |
41 | " apt search -qq foo | |
25b86db1 | 42 | testsuccessequal "foo/unstable 1.0 all |
859093da DK |
43 | $DESCR |
44 | " apt search -qq --names-only foo | |
1bef0dd5 MV |
45 | |
46 | # search with multiple words is a AND search | |
25b86db1 | 47 | testsuccessequal "foo/unstable 1.0 all |
1bef0dd5 MV |
48 | $DESCR |
49 | " apt search -qq aabbcc xxyyzz | |
25b86db1 | 50 | testsuccessequal "foo/unstable 1.0 all |
859093da DK |
51 | $DESCR |
52 | " apt search -qq 'a+b+c+' 'i*xxy{0,2}zz' | |
1bef0dd5 | 53 | |
01837669 | 54 | # search is not case-sensitive by default |
25b86db1 | 55 | testsuccessequal "foo/unstable 1.0 all |
01837669 MV |
56 | $DESCR |
57 | " apt search -qq uppercase | |
25b86db1 | 58 | testsuccessequal "foo/unstable 1.0 all |
859093da DK |
59 | $DESCR |
60 | " apt search -qq 'up[pP]erc[Aa]se' | |
01837669 | 61 | |
1a68655d | 62 | # search is done in the long description |
25b86db1 | 63 | testsuccessequal "foo/unstable 1.0 all |
1a68655d DK |
64 | $DESCR |
65 | " apt search -qq 'long description' | |
25b86db1 | 66 | testsuccessequal "foo/unstable 1.0 all |
1a68655d DK |
67 | $DESCR |
68 | Long description of stuff and such, with lines | |
69 | . | |
70 | and paragraphs and everything. | |
71 | " apt search --full -qq 'long description' | |
72 | ||
1bef0dd5 | 73 | # output is sorted and search word finds both package |
25b86db1 | 74 | testsuccessequal "bar/testing 2.0 i386 |
1bef0dd5 MV |
75 | $DESCR2 |
76 | ||
77 | foo/unstable 1.0 all | |
78 | $DESCR | |
79 | " apt search -qq aabbcc |