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

Method test_escape

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

Source from the content-addressed store, hash-verified

1177 self.assertEqual(decode(b + b'0'), (b + b'0', 2))
1178
1179 def test_escape(self):
1180 decode = codecs.escape_decode
1181 check = coding_checker(self, decode)
1182 check(b"[\\\n]", b"[]")
1183 check(br'[\"]', b'["]')
1184 check(br"[\']", b"[']")
1185 check(br"[\\]", b"[\\]")
1186 check(br"[\a]", b"[\x07]")
1187 check(br"[\b]", b"[\x08]")
1188 check(br"[\t]", b"[\x09]")
1189 check(br"[\n]", b"[\x0a]")
1190 check(br"[\v]", b"[\x0b]")
1191 check(br"[\f]", b"[\x0c]")
1192 check(br"[\r]", b"[\x0d]")
1193 check(br"[\7]", b"[\x07]")
1194 check(br"[\78]", b"[\x078]")
1195 check(br"[\41]", b"[!]")
1196 check(br"[\418]", b"[!8]")
1197 check(br"[\101]", b"[A]")
1198 check(br"[\1010]", b"[A0]")
1199 check(br"[\x41]", b"[A]")
1200 check(br"[\x410]", b"[A0]")
1201
1202 @unittest.expectedFailure # TODO: RUSTPYTHON; DeprecationWarning not triggered
1203 def test_warnings(self):

Callers

nothing calls this directly

Calls 2

coding_checkerFunction · 0.85
checkFunction · 0.70

Tested by

no test coverage detected