[pypy-commit] pypy jit-ordereddict: An extra passing test: bytearray slicing returns a bytearray, not a string

arigo noreply at buildbot.pypy.org
Wed Dec 25 22:13:57 CET 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: jit-ordereddict
Changeset: r68546:d861b2b9953e
Date: 2013-12-25 22:05 +0100
http://bitbucket.org/pypy/pypy/changeset/d861b2b9953e/

Log:	An extra passing test: bytearray slicing returns a bytearray, not a
	string

diff --git a/rpython/rtyper/test/test_rbytearray.py b/rpython/rtyper/test/test_rbytearray.py
--- a/rpython/rtyper/test/test_rbytearray.py
+++ b/rpython/rtyper/test/test_rbytearray.py
@@ -53,10 +53,13 @@
 
     def test_getslice(self):
         def f(x):
-            return str(bytearray(str(x))[1:2])
+            b = bytearray(str(x))
+            b = b[1:3]
+            b[0] += 5
+            return str(b)
 
-        ll_res = self.interpret(f, [123])
-        assert hlstr(ll_res) == "2"
+        ll_res = self.interpret(f, [12345])
+        assert hlstr(ll_res) == f(12345) == "73"
 
     def test_bytearray_not_constant(self):
         for constant in ['f', 'foo']:


More information about the pypy-commit mailing list