Author: Antonio Cuni <[email protected]>
Branch: unicode-strategies
Changeset: r58469:7a311e30b728
Date: 2012-10-26 19:09 +0200
http://bitbucket.org/pypy/pypy/changeset/7a311e30b728/
Log: add a test about string set strategy
diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py
--- a/pypy/objspace/std/setobject.py
+++ b/pypy/objspace/std/setobject.py
@@ -13,6 +13,7 @@
from pypy.objspace.std.listobject import W_ListObject
from pypy.objspace.std.intobject import W_IntObject
from pypy.objspace.std.stringobject import W_StringObject
+from pypy.objspace.std.unicodeobject import W_UnicodeObject
class W_BaseSetObject(W_Object):
typedef = None
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
@@ -1,5 +1,6 @@
from pypy.objspace.std.setobject import W_SetObject
-from pypy.objspace.std.setobject import IntegerSetStrategy, ObjectSetStrategy,
EmptySetStrategy
+from pypy.objspace.std.setobject import (IntegerSetStrategy, ObjectSetStrategy,
+ EmptySetStrategy, StringSetStrategy)
from pypy.objspace.std.listobject import W_ListObject
class TestW_SetStrategies:
@@ -20,6 +21,9 @@
s = W_SetObject(self.space, self.wrapped([]))
assert s.strategy is self.space.fromcache(EmptySetStrategy)
+ s = W_SetObject(self.space, self.wrapped(["a", "b"]))
+ assert s.strategy is self.space.fromcache(StringSetStrategy)
+
def test_switch_to_object(self):
s = W_SetObject(self.space, self.wrapped([1,2,3,4,5]))
s.add(self.space.wrap("six"))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit