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

Method test_branch_is_error

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

Source from the content-addressed store, hash-verified

229 self.assert_emit(b, """if (cpy_r_b) goto CPyL2;""", next_block=next_block)
230
231 def test_branch_is_error(self) -> None:
232 b = Branch(self.b, BasicBlock(8), BasicBlock(9), Branch.IS_ERROR)
233 self.assert_emit(
234 b,
235 """if (cpy_r_b == 2) {
236 goto CPyL8;
237 } else
238 goto CPyL9;
239 """,
240 )
241 b = Branch(self.b, BasicBlock(8), BasicBlock(9), Branch.IS_ERROR)
242 b.negated = True
243 self.assert_emit(
244 b,
245 """if (cpy_r_b != 2) {
246 goto CPyL8;
247 } else
248 goto CPyL9;
249 """,
250 )
251
252 def test_branch_is_error_next_block(self) -> None:
253 next_block = BasicBlock(8)

Callers

nothing calls this directly

Calls 3

assert_emitMethod · 0.95
BranchClass · 0.90
BasicBlockClass · 0.90

Tested by

no test coverage detected