MCPcopy Create free account
hub / github.com/python/mypy / test_emit_undefined_value_for_tuple

Method test_emit_undefined_value_for_tuple

mypyc/test/test_emit.py:70–80  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

68 assert emitter.c_undefined_value(bool_rprimitive) == "2"
69
70 def test_emit_undefined_value_for_tuple(self) -> None:
71 emitter = self.emitter
72 assert (
73 emitter.c_undefined_value(RTuple([str_rprimitive, int_rprimitive, bool_rprimitive]))
74 == "(tuple_T3OIC) { NULL, CPY_INT_TAG, 2 }"
75 )
76 assert emitter.c_undefined_value(RTuple([str_rprimitive])) == "(tuple_T1O) { NULL }"
77 assert (
78 emitter.c_undefined_value(RTuple([RTuple([str_rprimitive]), bool_rprimitive]))
79 == "(tuple_T2T1OC) { { NULL }, 2 }"
80 )
81
82 def test_emit_inc_ref_object(self) -> None:
83 self.emitter.emit_inc_ref("x", object_rprimitive)

Callers

nothing calls this directly

Calls 2

RTupleClass · 0.90
c_undefined_valueMethod · 0.45

Tested by

no test coverage detected