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

Method test_extend

mypyc/test/test_emitfunc.py:914–932  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

912 )
913
914 def test_extend(self) -> None:
915 a = Register(int32_rprimitive, "a")
916 self.assert_emit(Extend(a, int64_rprimitive, signed=True), """cpy_r_r0 = cpy_r_a;""")
917 self.assert_emit(
918 Extend(a, int64_rprimitive, signed=False), """cpy_r_r0 = (uint32_t)cpy_r_a;"""
919 )
920 if PLATFORM_SIZE == 4:
921 self.assert_emit(
922 Extend(self.n, int64_rprimitive, signed=True),
923 """cpy_r_r0 = (Py_ssize_t)cpy_r_n;""",
924 )
925 self.assert_emit(
926 Extend(self.n, int64_rprimitive, signed=False), """cpy_r_r0 = cpy_r_n;"""
927 )
928 if PLATFORM_SIZE == 8:
929 self.assert_emit(Extend(a, int_rprimitive, signed=True), """cpy_r_r0 = cpy_r_a;""")
930 self.assert_emit(
931 Extend(a, int_rprimitive, signed=False), """cpy_r_r0 = (uint32_t)cpy_r_a;"""
932 )
933
934 def test_inc_ref_none(self) -> None:
935 b = Box(self.none)

Callers

nothing calls this directly

Calls 3

assert_emitMethod · 0.95
RegisterClass · 0.90
ExtendClass · 0.90

Tested by

no test coverage detected