from lk_lambdex import lambdex


def test_fibonacci():
    fib = lambdex('n', """
        if n <= 0:
            raise ValueError()
            
        if n <= 2:
            return 1
            
        return somefunc(n - 1) + somefunc(n - 2)
    """)
    
    print('fib test (a):', fib(9))  # -> 34
    print('fib test (b):', fib(2))  # -> 1
    print('fib test (c):', fib(1))  # -> 1
    print('fib test (d):', fib(0))  # -> ValueError


if __name__ == '__main__':
    test_fibonacci()

from lk_lambdex import lambdex


def test_fibonacci():
    fib = lambdex('n', """
        if n <= 0:
            raise ValueError()
            
        if n <= 2:
            return 1
            
        return somefunc(n - 1) + somefunc(n - 2)
    """)
    
    print('fib test (a):', fib(9))  # -> 34
    print('fib test (b):', fib(2))  # -> 1
    print('fib test (c):', fib(1))  # -> 1
    print('fib test (d):', fib(0))  # -> ValueError


if __name__ == '__main__':
    test_fibonacci()

if n <= 0:             raise ValueError()                      if n <= 2:             return 1                      return somefunc(n - 1) + somefunc(n - 2) # -> 34 # -> 1 # -> 1 # -> ValueError