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

Method test_pprint

mypyc/test/test_ircheck.py:166–183  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

164 assert_has_error(fn, FnError(source=assign, desc="Func has a duplicate op"))
165
166 def test_pprint(self) -> None:
167 block_1 = self.basic_block([Return(value=NONE_VALUE)])
168 goto = Goto(label=block_1)
169 block_2 = self.basic_block([goto])
170 fn = FuncIR(
171 decl=self.func_decl(name="func_1"),
172 arg_regs=[],
173 # block_1 omitted
174 blocks=[block_2],
175 )
176 errors = [(goto, "Invalid control operation target: 1")]
177 formatted = format_func(fn, errors)
178 assert formatted == [
179 "def func_1():",
180 "L0:",
181 " \U0000274c goto L1",
182 " \U0001f446 ERROR: Invalid control operation target: 1",
183 ]
184
185 def test_load_address_declares_register(self) -> None:
186 rx = Register(str_rprimitive, "x")

Callers

nothing calls this directly

Calls 6

basic_blockMethod · 0.95
func_declMethod · 0.95
ReturnClass · 0.90
GotoClass · 0.90
FuncIRClass · 0.90
format_funcFunction · 0.90

Tested by

no test coverage detected