[pypy-svn] rev 2354 - pypy/trunk/src/pypy/objspace/std/test

alex at codespeak.net alex at codespeak.net
Tue Dec 16 12:06:49 CET 2003


Author: alex
Date: Tue Dec 16 12:06:48 2003
New Revision: 2354

Modified:
   pypy/trunk/src/pypy/objspace/std/test/test_dictobject.py
Log:
Added a test for dicts' str representation


Modified: pypy/trunk/src/pypy/objspace/std/test/test_dictobject.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/test/test_dictobject.py	(original)
+++ pypy/trunk/src/pypy/objspace/std/test/test_dictobject.py	Tue Dec 16 12:06:48 2003
@@ -303,6 +303,12 @@
         self.assertEqual(bool, True)
         bool = d1 < d4
         self.assertEqual(bool, False)
+
+    def test_str_repr(self):
+        self.assertEqual('{}', str({}))
+        self.assertEqual('{1: 2}', str({1: 2}))
+        self.assertEqual("{'ba': 'bo'}", str({'ba': 'bo'}))
+        self.assertEqual("{1: 2, 'ba': 'bo'}", str({1: 2, 'ba': 'bo'}))
         
     def tooslow_test_new(self):
         d = dict()


More information about the Pypy-commit mailing list