[pypy-commit] pypy kill-someobject: Add 3 tests, 2 of which failing.

arigo noreply at buildbot.pypy.org
Mon Oct 8 15:04:46 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: kill-someobject
Changeset: r57926:afa70036b7ef
Date: 2012-10-08 14:53 +0200
http://bitbucket.org/pypy/pypy/changeset/afa70036b7ef/

Log:	Add 3 tests, 2 of which failing.

diff --git a/pypy/rpython/test/test_rlist.py b/pypy/rpython/test/test_rlist.py
--- a/pypy/rpython/test/test_rlist.py
+++ b/pypy/rpython/test/test_rlist.py
@@ -622,6 +622,16 @@
                     res = self.interpret(fn, [i,j,case])
                     assert res is fn(i, j, case)
 
+    def test_list_compare_char_str(self):
+        def fn(i, j):
+            l1 = [str(i)]
+            l2 = [chr(j)]
+            return l1 == l2
+        res = self.interpret(fn, [65, 65])
+        assert res is False
+        res = self.interpret(fn, [1, 49])
+        assert res is True
+
 
     def test_list_compareinst(self):
         def fn(i, j, neg=False):
diff --git a/pypy/rpython/test/test_rstr.py b/pypy/rpython/test/test_rstr.py
--- a/pypy/rpython/test/test_rstr.py
+++ b/pypy/rpython/test/test_rstr.py
@@ -150,6 +150,16 @@
                                                         const('a')])
         assert res is False
 
+    def test_char_string_compare(self):
+        const = self.const
+        lst = [const('a'), const('abc')]
+        res = self.interpret(lambda i1, c2: (lst[i1],) == (c2,),
+                             [1, const('b')])
+        assert res is False
+        res = self.interpret(lambda i1, c2: (c2,) == (lst[i1],),
+                             [1, const('b')])
+        assert res is False
+
     def test_char_mul(self):
         const = self.const
         def fn(c, mul):
diff --git a/pypy/rpython/test/test_rtuple.py b/pypy/rpython/test/test_rtuple.py
--- a/pypy/rpython/test/test_rtuple.py
+++ b/pypy/rpython/test/test_rtuple.py
@@ -301,6 +301,16 @@
         res = self.interpret(f, [53])
         assert res is True
 
+    def test_compare_list_char_str(self):
+        def fn(i, j):
+            t1 = ([str(i)],)
+            t2 = ([chr(j)],)
+            return t1 == t2
+        res = self.interpret(fn, [65, 65])
+        assert res is False
+        res = self.interpret(fn, [1, 49])
+        assert res is True
+
     TUPLES = [
         ((1,2),  (2,3),   -1),
         ((1,2),  (1,3),   -1),


More information about the pypy-commit mailing list