@with_setup(setup=cleanup)
def test_recursion():
    def setup_cb():
        vim.vars['result1'] = 0
        vim.vars['result2'] = 0
        vim.vars['result3'] = 0
        vim.vars['result4'] = 0
        cmd = 'let g:result1 = rpcrequest(%d, "call", %d)' % (cid, 2,)
        vim.command(cmd)
        eq(vim.vars['result1'], 4)
        eq(vim.vars['result2'], 8)
        eq(vim.vars['result3'], 16)
        eq(vim.vars['result4'], 32)
        vim.stop_loop()

    def request_cb(name, args):
        n = args[0]
        n *= 2
        if 16 <= n:
            if n == 4:
                cmd = 'let g:result2 = rpcrequest(%d, "call", %d)' % (cid, n,)
            elif n == 8:
                cmd = 'let g:result3 = rpcrequest(%d, "call", %d)' % (cid, n,)
            elif n == 16:
                cmd = 'let g:result4 = rpcrequest(%d, "call", %d)' % (cid, n,)
            vim.command(cmd)
        return n

    vim.run_loop(request_cb, None, setup_cb)
dataset/ETHPy150Open neovim/python-client/test/test_client_rpc.py/test_recursion/swapped operands of `<=`