Commits

Antonio Cuni committed 7a311e3

add a test about string set strategy

  • Participants
  • Parent commits ff96600
  • Branches unicode-strategies

Comments (0)

Files changed (2)

pypy/objspace/std/setobject.py

 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

pypy/objspace/std/test/test_setstrategies.py

 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:
         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"))