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