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

Method test_branch

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

Source from the content-addressed store, hash-verified

191 )
192
193 def test_branch(self) -> None:
194 self.assert_emit(
195 Branch(self.b, BasicBlock(8), BasicBlock(9), Branch.BOOL),
196 """if (cpy_r_b) {
197 goto CPyL8;
198 } else
199 goto CPyL9;
200 """,
201 )
202 b = Branch(self.b, BasicBlock(8), BasicBlock(9), Branch.BOOL)
203 b.negated = True
204 self.assert_emit(
205 b,
206 """if (!cpy_r_b) {
207 goto CPyL8;
208 } else
209 goto CPyL9;
210 """,
211 )
212
213 def test_branch_no_else(self) -> None:
214 next_block = BasicBlock(9)

Callers

nothing calls this directly

Calls 3

assert_emitMethod · 0.95
BranchClass · 0.90
BasicBlockClass · 0.90

Tested by

no test coverage detected