diff options
author | Tianyu Chen <sweetyfish@deepin.org> | 2023-10-13 23:16:25 +0800 |
---|---|---|
committer | Tianyu Chen <sweetyfish@deepin.org> | 2023-12-08 11:05:59 +0800 |
commit | e129c031db9cf5b38e6f3597d2b8844576e6dd4f (patch) | |
tree | 47c1a9ef6e10cea50e259e4501daacf1cb3cb31c /test | |
parent | 8ab8ad65ea37261b96ee0a4fbcfade19075f8629 (diff) |
apt-pkg/cacheset.cc: set ShowErrors to true when no version matched
Enforce helper.canNotGetVersion to show error if no version matched.
Regression-of: 572810e9f321237873d1536c88991d7825c6f1db
Closes: #1053887
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/test-bug-1053887-regex-return-failure | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/integration/test-bug-1053887-regex-return-failure b/test/integration/test-bug-1053887-regex-return-failure new file mode 100755 index 000000000..46a03792f --- /dev/null +++ b/test/integration/test-bug-1053887-regex-return-failure @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +rm -f rootdir/etc/apt/sources.list +rm -f rootdir/etc/apt/sources.list.d/* + +insertinstalledpackage 'foo' 'all' '1' + +testfailureequal "Reading package lists... +Building dependency tree... +Note, selecting 'foo' for regex '^foo$' +Package foo is not available, but is referred to by another package. +This may mean that the package is missing, has been obsoleted, or +is only available from another source + +E: Version '2' for 'foo' was not found" apt install '^foo$'=2 |