Skip to content

Commit 7198898

Browse files
add more tests
1 parent cea2802 commit 7198898

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

mypyc/test-data/irbuild-bytes.test

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,31 +191,40 @@ def f(b: bytes) -> None:
191191
b.decode()
192192
b.decode('utf8')
193193
b.decode('utf-8', 'strict')
194-
b.decode('utf-8', 'strict')
194+
b.decode('latin-1')
195195
b.decode('latin1', 'strict')
196196
b.decode('ascii')
197-
b.decode('latin-1')
197+
b.decode('ascii', 'strict')
198198
b.decode('utf-8', 'ignore')
199199
b.decode('ascii', 'replace')
200200
b.decode('latin1', 'ignore')
201+
b'test_utf8'.decode('utf8')
202+
b'test_latin1'.decode('latin1')
203+
b'test_ascii'.decode('ascii')
201204
[out]
202205
def f(b):
203206
b :: bytes
204207
r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21 :: str
208+
r22 :: bytes
209+
r23 :: str
210+
r24 :: bytes
211+
r25 :: str
212+
r26 :: bytes
213+
r27 :: str
205214
L0:
206215
r0 = CPy_DecodeUtf8(b)
207216
r1 = CPy_DecodeUtf8(b)
208217
r2 = 'utf-8'
209218
r3 = 'strict'
210219
r4 = CPy_Decode(b, r2, r3)
211-
r5 = 'utf-8'
212-
r6 = 'strict'
213-
r7 = CPy_Decode(b, r5, r6)
214-
r8 = 'latin1'
215-
r9 = 'strict'
216-
r10 = CPy_Decode(b, r8, r9)
217-
r11 = CPy_DecodeAscii(b)
218-
r12 = CPy_DecodeLatin1(b)
220+
r5 = CPy_DecodeLatin1(b)
221+
r6 = 'latin1'
222+
r7 = 'strict'
223+
r8 = CPy_Decode(b, r6, r7)
224+
r9 = CPy_DecodeAscii(b)
225+
r10 = 'ascii'
226+
r11 = 'strict'
227+
r12 = CPy_Decode(b, r10, r11)
219228
r13 = 'utf-8'
220229
r14 = 'ignore'
221230
r15 = CPy_Decode(b, r13, r14)
@@ -225,4 +234,10 @@ L0:
225234
r19 = 'latin1'
226235
r20 = 'ignore'
227236
r21 = CPy_Decode(b, r19, r20)
237+
r22 = b'test_utf8'
238+
r23 = CPy_DecodeUtf8(r22)
239+
r24 = b'test_latin1'
240+
r25 = CPy_DecodeLatin1(r24)
241+
r26 = b'test_ascii'
242+
r27 = CPy_DecodeAscii(r26)
228243
return 1

0 commit comments

Comments
 (0)