Lines Matching defs:check
32 def check(input, expect):
34 return check
116 # the StreamReader and check that the results equal the appropriate
125 # check that there's nothing left in the buffers
129 # do the check again, this time using an incremental decoder
135 # check that there's nothing left in the buffers
145 # check that there's nothing left in the buffers
149 # check iterdecode()
474 # check whether there is exactly one BOM in it
658 # check whether there is exactly one BOM in it
1112 # SF bug #1601501: check that the codec works with a buffer
1179 check = coding_checker(self, decode)
1180 check(b"[\\\n]", b"[]")
1181 check(br'[\"]', b'["]')
1182 check(br"[\']", b"[']")
1183 check(br"[\\]", b"[\\]")
1184 check(br"[\a]", b"[\x07]")
1185 check(br"[\b]", b"[\x08]")
1186 check(br"[\t]", b"[\x09]")
1187 check(br"[\n]", b"[\x0a]")
1188 check(br"[\v]", b"[\x0b]")
1189 check(br"[\f]", b"[\x0c]")
1190 check(br"[\r]", b"[\x0d]")
1191 check(br"[\7]", b"[\x07]")
1192 check(br"[\78]", b"[\x078]")
1193 check(br"[\41]", b"[!]")
1194 check(br"[\418]", b"[!8]")
1195 check(br"[\101]", b"[A]")
1196 check(br"[\1010]", b"[A0]")
1197 check(br"[\x41]", b"[A]")
1198 check(br"[\x410]", b"[A0]")
1203 check(b"\\" + b, b"\\" + b)
1205 check(b"\\" + b.upper(), b"\\" + b.upper())
1207 check(br"\8", b"\\8")
1209 check(br"\9", b"\\9")
1211 check(b"\\\xfa", b"\\\xfa")
1214 check(rb'\%o' % i, bytes([i & 0o377]))
1927 # check stream reader/writer
1945 # check incremental decoder/encoder and iterencode()/iterdecode()
1951 # check incremental decoder/encoder
1964 # check iterencode()/iterdecode()
1969 # check iterencode()/iterdecode() with empty string
1975 # check incremental decoder/encoder with errors argument
1994 # check incremental decoder/encoder (fetched via the C API)
2000 # check C API
2014 # check incremental decoder/encoder with errors argument
2396 check = coding_checker(self, encode)
2397 check('\t', br'\t')
2398 check('\n', br'\n')
2399 check('\r', br'\r')
2400 check('\\', br'\\')
2403 check(chr(b), ('\\x%02x' % b).encode())
2405 check(chr(b), ('\\x%02x' % b).encode())
2406 check('\u20ac', br'\u20ac')
2407 check('\U0001d120', br'\U0001d120')
2411 check = coding_checker(self, decode)
2412 check(b"[\\\n]", "[]")
2413 check(br'[\"]', '["]')
2414 check(br"[\']", "[']")
2415 check(br"[\\]", r"[\]")
2416 check(br"[\a]", "[\x07]")
2417 check(br"[\b]", "[\x08]")
2418 check(br"[\t]", "[\x09]")
2419 check(br"[\n]", "[\x0a]")
2420 check(br"[\v]", "[\x0b]")
2421 check(br"[\f]", "[\x0c]")
2422 check(br"[\r]", "[\x0d]")
2423 check(br"[\7]", "[\x07]")
2424 check(br"[\78]", "[\x078]")
2425 check(br"[\41]", "[!]")
2426 check(br"[\418]", "[!8]")
2427 check(br"[\101]", "[A]")
2428 check(br"[\1010]", "[A0]")
2429 check(br"[\x41]", "[A]")
2430 check(br"[\x410]", "[A0]")
2431 check(br"\u20ac", "\u20ac")
2432 check(br"\U0001d120", "\U0001d120")
2437 check(b"\\" + b, "\\" + chr(i))
2440 check(b"\\" + b.upper(), "\\" + chr(i-32))
2442 check(br"\8", "\\8")
2444 check(br"\9", "\\9")
2446 check(b"\\\xfa", "\\\xfa")
2449 check(rb'\%o' % i, chr(i))
2527 check = coding_checker(self, encode)
2530 check('\\' + chr(b), b'\\' + bytes([b]))
2531 check('\u20ac', br'\u20ac')
2532 check('\U0001d120', br'\U0001d120')
2536 check = coding_checker(self, decode)
2539 check(b'\\' + bytes([b]), '\\' + chr(b))
2540 check(br"\u20ac", "\u20ac")
2541 check(br"\U0001d120", "\U0001d120")
2761 # We check all the transform codecs accept memoryview input
3177 # so check for the codepage before decoding