def test_inlined_function(self):
        def f(i):
            return i - 1
        def main():
            i = 1500
            while i > 0:
                i = f(i)
                i

        with tracebin.record() as recorder:
            main()

        [trace] = recorder.traces
        [entry, preamble, loop] = trace.sections
        assert len(loop.chunks) == 10

        assert loop.chunks[0].get_op_names() == ["label"]
        assert loop.chunks[1].sourcelines == [
            """        def main():\n""",
            """            i = 1500\n""",
            """            while i > 0:\n""",
        ]
        assert loop.chunks[2].get_op_names() == ["debug_merge_point", "debug_merge_point", "debug_merge_point", "int_gt", "guard_true", "debug_merge_point"]
        assert loop.chunks[3].sourcelines == [
            """                i = f(i)\n""",
        ]
        assert loop.chunks[4].get_op_names() == ["debug_merge_point", "debug_merge_point", "debug_merge_point", "force_token"]
        assert loop.chunks[5].sourcelines == [
            """        def f(i):\n""",
            """            return i - 1\n""",
        ]
        assert loop.chunks[5].linenos == [122, 123]
        assert loop.chunks[6].get_op_names() == ["debug_merge_point", "debug_merge_point", "debug_merge_point", "int_sub", "debug_merge_point"]
        assert loop.chunks[7].get_op_names() == ["debug_merge_point"]
        assert loop.chunks[8].sourcelines == [
            """                i\n""",
        ]
        if self.thread_spawned():
            assert loop.chunks[9].get_op_names() == ["debug_merge_point", "debug_merge_point", "debug_merge_point", "guard_not_invalidated", "getfield_raw", "int_sub", "setfield_raw", "int_lt", "guard_false", "debug_merge_point", "jump"]
        else:
            assert loop.chunks[9].get_op_names() == ["debug_merge_point", "debug_merge_point", "debug_merge_point", "guard_not_invalidated", "getfield_raw", "int_lt", "guard_false", "debug_merge_point", "jump"]
dataset/ETHPy150Open alex/tracebin/client/tests/test_hook.py/TestHook.test_inlined_function/original