test_merge_order: fix ambigous_merge_order bug
authorZac Medico <zmedico@gentoo.org>
Sat, 21 May 2011 01:11:56 +0000 (18:11 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 May 2011 01:11:56 +0000 (18:11 -0700)
pym/portage/tests/resolver/ResolverPlayground.py
pym/portage/tests/resolver/test_merge_order.py

index 5d1c1b39cfaa7bd3c0cd888c82d046ef2fd9ffc2..298107c0692cc49baee7b6fd8a7e035d7d289a01 100644 (file)
@@ -536,8 +536,11 @@ class ResolverPlaygroundTestCase(object):
                                                got_token = got_stack.pop()
                                                expected_obj = expected_stack.pop()
                                                if isinstance(expected_obj, basestring):
-                                                       new_expected.append(got_token)
-                                                       continue
+                                                       new_expected.append(expected_obj)
+                                                       if got_token == expected_obj:
+                                                               continue
+                                                       # result doesn't match, so stop early
+                                                       break
                                                expected_obj = set(expected_obj)
                                                try:
                                                        expected_obj.remove(got_token)
index 9c5d1fe3fedec2cea4ba23813a8822e0bec54b44..f51d14f6bf00c18ea8a5149ab7e5e29be6289326 100644 (file)
@@ -46,7 +46,7 @@ class MergeOrderTestCase(TestCase):
                        # Test optimal merge order for a circular dep that is
                        # RDEPEND in one direction and PDEPEND in the other.
                        ResolverPlaygroundTestCase(
-                               ["app-misc/some-app-a"],
+                               ["app-misc/some-app-b"],
                                success = True,
                                ambigous_merge_order = True,
                                mergelist = ["app-misc/circ-post-runtime-a-1", "app-misc/circ-post-runtime-b-1", "app-misc/some-app-b-1"]),