]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-cli-search
improve partial/ cleanup in abort and failure cases
[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
28testfailureequal 'E: You must give at least one search pattern' aptcache search
29testfailureequal 'E: You must give at least one search pattern' apt search
30
31# with OP progress
32testsuccessequal "Sorting...
33Full Text Search...
34foo/unstable 1.0 all
35 $DESCR
36" apt search xxyyzz
37
38# without op progress
39testsuccessequal "foo/unstable 1.0 all
40 $DESCR
41" apt search -qq xxyyzz
42testempty apt search -qq --names-only xxyyzz
43
44# search name
45testsuccessequal "foo/unstable 1.0 all
46 $DESCR
47" apt search -qq foo
48testsuccessequal "foo/unstable 1.0 all
49 $DESCR
50" apt search -qq --names-only foo
51
52# search with multiple words is a AND search
53testsuccessequal "foo/unstable 1.0 all
54 $DESCR
55" apt search -qq aabbcc xxyyzz
56testsuccessequal "foo/unstable 1.0 all
57 $DESCR
58" apt search -qq 'a+b+c+' 'i*xxy{0,2}zz'
59
60# search is not case-sensitive by default
61testsuccessequal "foo/unstable 1.0 all
62 $DESCR
63" apt search -qq uppercase
64testsuccessequal "foo/unstable 1.0 all
65 $DESCR
66" apt search -qq 'up[pP]erc[Aa]se'
67
68# search is done in the long description
69testsuccessequal "foo/unstable 1.0 all
70 $DESCR
71" apt search -qq 'long description'
72testsuccessequal "foo/unstable 1.0 all
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
79# output is sorted and search word finds both package
80testsuccessequal "bar/testing 2.0 i386
81 $DESCR2
82
83foo/unstable 1.0 all
84 $DESCR
85" apt search -qq aabbcc