[pypy-svn] r66642 - in pypy/branch/io-lang/pypy/lang/io: . test

david at codespeak.net david at codespeak.net
Sun Jul 26 19:52:09 CEST 2009


Author: david
Date: Sun Jul 26 19:52:08 2009
New Revision: 66642

Modified:
   pypy/branch/io-lang/pypy/lang/io/model.py
   pypy/branch/io-lang/pypy/lang/io/test/test_map.py
Log:
fix for Map hasValue

Modified: pypy/branch/io-lang/pypy/lang/io/model.py
==============================================================================
--- pypy/branch/io-lang/pypy/lang/io/model.py	(original)
+++ pypy/branch/io-lang/pypy/lang/io/model.py	Sun Jul 26 19:52:08 2009
@@ -130,7 +130,7 @@
             
     def has_value(self, w_value):
         for x in self.items.values():
-            if x.value == x:
+            if x.value == w_value:
                 return True
         return False
         

Modified: pypy/branch/io-lang/pypy/lang/io/test/test_map.py
==============================================================================
--- pypy/branch/io-lang/pypy/lang/io/test/test_map.py	(original)
+++ pypy/branch/io-lang/pypy/lang/io/test/test_map.py	Sun Jul 26 19:52:08 2009
@@ -74,13 +74,13 @@
     assert values == ['nil', 3, 234]
     
 def test_has_value():
-    inp = 'Map clone atPut("1", "nil") atPut("2", "lorem") atPut("3", 3) atPut("4", 234) hasValue("234")'
+    inp = 'Map clone atPut("1", "nil") atPut("2", "lorem") atPut("3", 3) atPut("4", 234) hasValue(234)'
     res, space = interpret(inp)
-    assert res == space.w_true
+    assert res is space.w_true
     
     inp = 'Map clone atPut("1", "nil") atPut("2", "lorem") atPut("3", 3) atPut("4", 234) hasValue("1234567890")'
     res, space = interpret(inp)
-    assert res == space.w_false
+    assert res is space.w_false
     
 def test_values():
     inp = 'Map clone atPut("1", 12345) atPut("2", 99) atPut("3", 3) atPut("4", 234) values'
@@ -167,4 +167,4 @@
   inp = """Map with("a", 1, "b", 2) asObject"""
   res, space = interpret(inp)
   assert res.slots['a'].value == 1
-  assert res.slots['b'].value == 2
\ No newline at end of file
+  assert res.slots['b'].value == 2



More information about the Pypy-commit mailing list