Skip to content

Commit 080ec09

Browse files
authored
Merge pull request #7 from bkamins/master
Add esc to @tee
2 parents 682a90c + 26f7f6c commit 080ec09

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/Queryverse.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export DV
1919

2020
export @tee
2121

22-
macro tee(x)
22+
macro tee(ex)
2323
quote
2424
x -> begin
25-
x |> $(x)
25+
x |> $(esc(ex))
2626
return x
2727
end
2828
end

test/runtests.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@ DataFrame
1919

2020
@test size(df) == (2,2)
2121

22-
end
22+
io = IOBuffer()
23+
f(x) = print(io, sum(x + x))
24+
1:10 |> @tee(f) |> x -> print(io, " ", sum(x))
25+
@test String(take!(io)) == "110 55"
26+
27+
end

0 commit comments

Comments
 (0)