Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pacman/meson.build1
-rw-r--r--test/pacman/tests/TESTS1
-rw-r--r--test/pacman/tests/replace-and-upgrade-package.py27
3 files changed, 29 insertions, 0 deletions
diff --git a/test/pacman/meson.build b/test/pacman/meson.build
index cf64296e..3ad1fcd0 100644
--- a/test/pacman/meson.build
+++ b/test/pacman/meson.build
@@ -148,6 +148,7 @@ pacman_tests = [
{ 'name': 'tests/remove060.py' },
{ 'name': 'tests/remove070.py' },
{ 'name': 'tests/remove071.py' },
+ { 'name': 'tests/replace-and-upgrade-package.py' },
{ 'name': 'tests/replace100.py' },
{ 'name': 'tests/replace101.py' },
{ 'name': 'tests/replace102.py' },
diff --git a/test/pacman/tests/TESTS b/test/pacman/tests/TESTS
index dc0b4ec3..74c8f674 100644
--- a/test/pacman/tests/TESTS
+++ b/test/pacman/tests/TESTS
@@ -144,6 +144,7 @@ TESTS += test/pacman/tests/remove052.py
TESTS += test/pacman/tests/remove060.py
TESTS += test/pacman/tests/remove070.py
TESTS += test/pacman/tests/remove071.py
+TESTS += test/pacman/tests/replace-and-upgrade-package.py
TESTS += test/pacman/tests/replace100.py
TESTS += test/pacman/tests/replace101.py
TESTS += test/pacman/tests/replace102.py
diff --git a/test/pacman/tests/replace-and-upgrade-package.py b/test/pacman/tests/replace-and-upgrade-package.py
new file mode 100644
index 00000000..ef2152a7
--- /dev/null
+++ b/test/pacman/tests/replace-and-upgrade-package.py
@@ -0,0 +1,27 @@
+self.description = 'Simultaneously replace and upgrade a package'
+
+# replacement package
+sp1 = pmpkg('foo1', '1-2')
+sp1.replaces = ['foo=1-1']
+sp1.conflicts = ['foo=1-1']
+self.addpkg2db('sync', sp1)
+
+# upgrade package
+sp2 = pmpkg('foo', '2-1')
+self.addpkg2db('sync', sp2)
+
+# depend on upgraded package to pull it into transaction
+sp3 = pmpkg('bar', '1-1')
+sp3.depends = [ 'foo=2-1' ]
+self.addpkg2db('sync', sp3)
+
+lp = pmpkg('foo', '1-1')
+self.addpkg2db('local', lp)
+
+self.args = "-Su bar"
+
+self.addrule('PACMAN_RETCODE=0')
+self.addrule('PKG_VERSION=foo1|1-2')
+self.addrule('PKG_VERSION=foo|2-1')
+self.addrule('PKG_VERSION=bar|1-1')
+self.addrule('!PACMAN_OUTPUT=error')