MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_escape_encode

Method test_escape_encode

Lib/test/test_codecs.py:2650–2663  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2648 self.assertEqual(decode(bytes([b]) + b'0'), (chr(b) + '0', 2))
2649
2650 def test_escape_encode(self):
2651 encode = codecs.unicode_escape_encode
2652 check = coding_checker(self, encode)
2653 check('\t', br'\t')
2654 check('\n', br'\n')
2655 check('\r', br'\r')
2656 check('\\', br'\\')
2657 for b in range(32):
2658 if chr(b) not in '\t\n\r':
2659 check(chr(b), ('\\x%02x' % b).encode())
2660 for b in range(127, 256):
2661 check(chr(b), ('\\x%02x' % b).encode())
2662 check('\u20ac', br'\u20ac')
2663 check('\U0001d120', br'\U0001d120')
2664
2665 def test_escape_decode(self):
2666 decode = codecs.unicode_escape_decode

Callers

nothing calls this directly

Calls 4

coding_checkerFunction · 0.85
chrFunction · 0.85
checkFunction · 0.70
encodeMethod · 0.45

Tested by

no test coverage detected