Skip to content

Commit 864a11b

Browse files
committed
fix tests
1 parent 9010e28 commit 864a11b

2 files changed

Lines changed: 29 additions & 23 deletions

File tree

mypyc/test-data/irbuild-bytes.test

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -299,26 +299,3 @@ def foo(b: bytes, ba: bytearray) -> None:
299299
[out]
300300
main:7: error: Argument 1 to "bytes_func" has incompatible type "bytearray"; expected "bytes"
301301
main:8: error: Argument 1 to "bytearray_func" has incompatible type "bytes"; expected "bytearray"
302-
303-
[case testBytesConcatRefcount]
304-
def f(a: bytes, b: bytes) -> bytes:
305-
return b"1" + b
306-
[out]
307-
def f(a, b):
308-
a, b, r0, r1 :: bytes
309-
L0:
310-
r0 = b'1'
311-
r1 = CPyBytes_Concat(r0, b)
312-
return r1
313-
314-
[case testChainedBytesConcatRefcount]
315-
def f(a: bytes, b: bytes, c: bytes) -> bytes:
316-
return b"1" + b + c
317-
[out]
318-
def f(a, b, c):
319-
a, b, c, r0, r1, r2 :: bytes
320-
L0:
321-
r0 = b'1'
322-
r1 = CPyBytes_Concat(r0, b)
323-
r2 = CPyBytes_Concat(r1, c)
324-
return r2

mypyc/test-data/refcount.test

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,3 +2125,32 @@ L3:
21252125
r8 = box(None, 1)
21262126
inc_ref r8
21272127
return r8
2128+
2129+
[case testBytesConcatRefcount]
2130+
def f(a: bytes, b: bytes) -> bytes:
2131+
return b"1" + a + b
2132+
[out]
2133+
def f(a, b):
2134+
a, b, r0, r1, r2 :: bytes
2135+
L0:
2136+
r0 = b'1'
2137+
r1 = CPyBytes_Concat(r0, a)
2138+
r2 = CPyBytes_Concat(r1, b)
2139+
dec_ref r1
2140+
return r2
2141+
2142+
[case testChainedBytesConcatRefcount]
2143+
def f(a: bytes, b: bytes, c: bytes) -> bytes:
2144+
return b"1" + a + b + c
2145+
[out]
2146+
def f(a, b, c):
2147+
a, b, c, r0, r1, r2, r3 :: bytes
2148+
L0:
2149+
r0 = b'1'
2150+
r1 = CPyBytes_Concat(r0, a)
2151+
r2 = CPyBytes_Concat(r1, b)
2152+
dec_ref r1
2153+
r3 = CPyBytes_Concat(r2, c)
2154+
dec_ref r2
2155+
return r3
2156+

0 commit comments

Comments
 (0)