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>
Thu, 26 May 2011 03:42:45 +0000 (20:42 -0700)
pym/portage/tests/resolver/ResolverPlayground.py
pym/portage/tests/resolver/test_merge_order.py

index bc2f80010abe8b4fdecf723cc1b7e647c888937f..402db7baee132eedcff133b77f92320914091ee1 100644 (file)
@@ -529,8 +529,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"]),