Author: Lukas Diekmann <[email protected]>
Branch: set-strategies
Changeset: r49176:88dd201179d2
Date: 2011-05-24 11:51 +0200
http://bitbucket.org/pypy/pypy/changeset/88dd201179d2/

Log:    added strategy test for union

diff --git a/pypy/objspace/std/test/test_setstrategies.py 
b/pypy/objspace/std/test/test_setstrategies.py
--- a/pypy/objspace/std/test/test_setstrategies.py
+++ b/pypy/objspace/std/test/test_setstrategies.py
@@ -52,3 +52,12 @@
         set_remove__Set_ANY(self.space, s1, self.space.wrap(1))
         assert s1.strategy is self.space.fromcache(EmptySetStrategy)
 
+    def test_union(self):
+        from pypy.objspace.std.setobject import set_union__Set
+        s1 = W_SetObject(self.space, self.wrapped([1,2,3,4,5]))
+        s2 = W_SetObject(self.space, self.wrapped([4,5,6,7]))
+        s3 = W_SetObject(self.space, self.wrapped([4,'5','6',7]))
+        s4 = set_union__Set(self.space, s1, [s2])
+        s5 = set_union__Set(self.space, s1, [s3])
+        assert s4.strategy is self.space.fromcache(IntegerSetStrategy)
+        assert s5.strategy is self.space.fromcache(ObjectSetStrategy)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to