diff --git a/lazy/test_underscore.py b/lazy/test_underscore.py index 3e3969d..5a75e60 100644 --- a/lazy/test_underscore.py +++ b/lazy/test_underscore.py @@ -1,4 +1,4 @@ -from .lazy import _, F +from .lazy import dsl def test_underscore_calculate(): @@ -30,20 +30,20 @@ def test_underscore_with_functions(): def add(x, y): return x + y - f = F(str)(_ + 3) + f = str(_ + 3) assert f(2) == "5" - f = F(add)(_, 3) + f = add(_, 3) assert f(2) == 5 - f = F(add)(x=_, y=3) + f = add(x=_, y=3) assert f(2) == 5 - f = F(add)(_, y=3) + f = add(_, y=3) assert f(2) == 5 - assert list(map(F(str)(_ * 2), [1, 2, 3])) == ['2', '4', '6'] - assert list(map(F(str)(_ * _), [1, 2, 3])) == ['1', '4', '9'] - assert list(map(F(add)(1, _ * 2), [1, 2, 3])) == [3, 5, 7] - assert list(map(F(add)(_ * 2, 4), [1, 2, 3])) == [6, 8, 10] - assert list(map(F(add)(_ * 3, _ + 2), [1, 2, 3])) == [6, 10, 14] + assert list(map(str(_ * 2), [1, 2, 3])) == ['2', '4', '6'] + assert list(map(str(_ * _), [1, 2, 3])) == ['1', '4', '9'] + assert list(map(add(1, _ * 2), [1, 2, 3])) == [3, 5, 7] + assert list(map(add(_ * 2, 4), [1, 2, 3])) == [6, 8, 10] + assert list(map(add(_ * 3, _ + 2), [1, 2, 3])) == [6, 10, 14]