Skip to content

Commit

Permalink
more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Doris committed Jan 1, 2025
1 parent 267333b commit 944c479
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,27 @@ end
(input = @ex(f() << x), output = @ex(tmp1 = x, f(tmp1))),
(input = @ex(f(y, z; w = 3) << x), output = @ex(tmp1 = x, f(tmp1, y, z; w = 3))),
(input = @ex(f(y, _, z; w = 3) << x), output = @ex(tmp1 = x, f(y, tmp1, z; w = 3))),
# _, __, ___, etc
(input = @ex(x >> f(__, ___)), output = @ex(tmp1 = x, f(tmp1, _, __))),
(input = @ex(x >> f(__, ___, _)), output = @ex(tmp1 = x, f(_, __, tmp1))),
(
input = @ex(x >> f(__) >> g(___, _) >> h(_, __)),
output = @ex(tmp1 = x, tmp2 = f(tmp1, _), tmp3 = g(__, tmp2), h(tmp3, _))
),
# combine >> <<
(input = @ex(x >> f() << y), output = @ex(tmp2 = y, tmp1 = x, f(tmp2, tmp1))),
(
input = @ex(x >> f(z, _) << y),
output = @ex(tmp2 = y, tmp1 = x, f(tmp2, z, tmp1))
),
(
input = @ex(x >> f(z, __) << y),
output = @ex(tmp2 = y, tmp1 = x, f(tmp1, z, tmp2))
),
(
input = @ex(x >> f(z, __, _) << y),
output = @ex(tmp2 = y, tmp1 = x, f(z, tmp2, tmp1))
),
# substitute the function being called
(input = @ex(f >> _(x, y)), output = @ex(tmp1 = f, tmp1(x, y))),
# infix calls
Expand Down

0 comments on commit 944c479

Please sign in to comment.