MCPcopy Index your code
hub / github.com/python/mypy / test_encode_int_values

Method test_encode_int_values

mypyc/test/test_literals.py:46–55  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

44 assert _encode_bytes_values({b"y" * 100: 0}) == [bytes([1, 100]) + b"y" * 100, b""]
45
46 def test_encode_int_values(self) -> None:
47 assert _encode_int_values({}) == [b""]
48 assert _encode_int_values({123: 0}) == [b"\x01123", b""]
49 assert _encode_int_values({123: 0, 9: 1}) == [b"\x02123\x009", b""]
50 assert _encode_int_values({123: 0, 45: 1, 5 * 10**70: 2}) == [
51 b"\x02123\x0045",
52 b"\x015" + b"0" * 70,
53 b"",
54 ]
55 assert _encode_int_values({6 * 10**100: 0}) == [b"\x016" + b"0" * 100, b""]
56
57 def test_simple_literal_index(self) -> None:
58 lit = Literals()

Callers

nothing calls this directly

Calls 1

_encode_int_valuesFunction · 0.90

Tested by

no test coverage detected