Commits

Armin Rigo committed d861b2b

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

Comments (0)

Files changed (1)

rpython/rtyper/test/test_rbytearray.py

 
     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']: