Skip to content

Commit

Permalink
fixup! Add at-par macro
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsamaroo committed Oct 23, 2020
1 parent d64f22d commit 64b8a3b
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions test/thunk.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
@testset "@par" begin
x = 2
a = @par x + x
@test a isa Dagger.Thunk
b = @par sum([x,1,2])
c = @par a * b
@test collect(c) == 20

c = @par begin
@testset "per-call" begin
x = 2
a = x + x
b = sum([x,1,2])
c = a * b
a = @par x + x
@test a isa Dagger.Thunk
b = @par sum([x,1,2])
c = @par a * b
@test collect(c) == 20
end

@testset "block" begin
c = @par begin
x = 2
a = x + x
b = sum([x,1,2])
c = a * b
end
@test x isa Int
@test a isa Dagger.Thunk
@test c isa Dagger.Thunk
@test collect(c) == 20
end
@test x isa Int
@test a isa Dagger.Thunk
@test c isa Dagger.Thunk
@test collect(c) == 20
end

0 comments on commit 64b8a3b

Please sign in to comment.