From 8ba17539a3ec33abc283ca382cca6e59876a0f07 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 25 May 2013 19:57:48 +0200 Subject: fix support for multiple patterns in apt-cache search Patterns can appear in the name as well as in the description, they don't have to match all in the name/description only. Closes: 691453 --- .../test-bug-691453-apt-cache-search-multi-pattern | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 test/integration/test-bug-691453-apt-cache-search-multi-pattern (limited to 'test/integration/test-bug-691453-apt-cache-search-multi-pattern') diff --git a/test/integration/test-bug-691453-apt-cache-search-multi-pattern b/test/integration/test-bug-691453-apt-cache-search-multi-pattern new file mode 100755 index 000000000..0367892fc --- /dev/null +++ b/test/integration/test-bug-691453-apt-cache-search-multi-pattern @@ -0,0 +1,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' + +testequal "$FOOBAR" aptcache search foo +testequal "$FOOBAR" aptcache search bar +testequal "$FOOBAR" aptcache search foo bar + +testequal 'foobar - funky tool +foo - tool best used with bar' aptcache search -n foo +testequal 'foobar - funky tool +bar - tool best used with foo +baz - alternative tool best used with foo' aptcache search -n bar +testequal 'foobar - funky tool' aptcache search -n foo bar -- cgit v1.2.3