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