]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-cli-search
Merge pull request julian-klode/apt#3 from adrian17/master
[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
10DESCR='Some description that has a unusual word xxyyzz and aabbcc and a UPPERCASE'
11DESCR2='Some other description with the unusual aabbcc only'
12insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR
13 Long description of stuff and such, with lines
14 .
15 and paragraphs and everything."
16insertpackage 'testing' 'bar' 'i386' '2.0' '' '' "$DESCR2"
17
18setupaptarchive
19
20APTARCHIVE="$(readlink -f ./aptarchive)"
21
22testfailureequal 'E: You must give at least one search pattern' aptcache search
23testfailureequal 'E: You must give at least one search pattern' apt search
24
25# with OP progress
26testsuccessequal "Sorting...
27Full Text Search...
28foo/unstable 1.0 all
29 $DESCR
30" apt search xxyyzz
31
32# without op progress
33testsuccessequal "foo/unstable 1.0 all
34 $DESCR
35" apt search -qq xxyyzz
36testempty apt search -qq --names-only xxyyzz
37
38# search name
39testsuccessequal "foo/unstable 1.0 all
40 $DESCR
41" apt search -qq foo
42testsuccessequal "foo/unstable 1.0 all
43 $DESCR
44" apt search -qq --names-only foo
45
46# search with multiple words is a AND search
47testsuccessequal "foo/unstable 1.0 all
48 $DESCR
49" apt search -qq aabbcc xxyyzz
50testsuccessequal "foo/unstable 1.0 all
51 $DESCR
52" apt search -qq 'a+b+c+' 'i*xxy{0,2}zz'
53
54# search is not case-sensitive by default
55testsuccessequal "foo/unstable 1.0 all
56 $DESCR
57" apt search -qq uppercase
58testsuccessequal "foo/unstable 1.0 all
59 $DESCR
60" apt search -qq 'up[pP]erc[Aa]se'
61
62# search is done in the long description
63testsuccessequal "foo/unstable 1.0 all
64 $DESCR
65" apt search -qq 'long description'
66testsuccessequal "foo/unstable 1.0 all
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
73# output is sorted and search word finds both package
74testsuccessequal "bar/testing 2.0 i386
75 $DESCR2
76
77foo/unstable 1.0 all
78 $DESCR
79" apt search -qq aabbcc