summaryrefslogtreecommitdiffstats
path: root/test/integration/test-bug-691453-apt-cache-search-multi-pattern
blob: 8aa6ca732611e03a25d5b402a2e2433b2f6a7951 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
set -e

TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
configarchitecture 'native'

insertpackage 'unstable' 'foobar' 'native' '1' '' '' 'funky tool'
insertpackage 'unstable' 'coolstuff' 'native' '1' '' '' 'funky tool just like foo and bar'
insertpackage 'unstable' 'foo' 'native' '1' '' '' 'tool best used with bar'
insertpackage 'unstable' 'bar' 'native' '1' '' '' 'tool best used with foo'
insertpackage 'unstable' 'baz' 'native' '1' 'Provides: bar' '' 'alternative tool best used with foo'

setupaptarchive

# in this special case the following queries should be equal
FOOBAR='foobar - funky tool
coolstuff - funky tool just like foo and bar
foo - tool best used with bar
bar - tool best used with foo
baz - alternative tool best used with foo'

testsuccessequal "$FOOBAR" aptcache search foo
testsuccessequal "$FOOBAR" aptcache search bar
testsuccessequal "$FOOBAR" aptcache search foo bar

testsuccessequal 'foobar - funky tool
foo - tool best used with bar' aptcache search -n foo
testsuccessequal 'foobar - funky tool
bar - tool best used with foo
baz - alternative tool best used with foo' aptcache search -n bar
testsuccessequal 'foobar - funky tool' aptcache search -n foo bar