Skip to content

Commit

Permalink
more test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Apr 12, 2022
1 parent 7aa4a7d commit b22b618
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/opaque_closure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,16 @@ end
let ci = code_typed(+, (Int, Int))[1][1]
ir = Core.Compiler.inflate_ir(ci)
@test OC(ir, 2, false)(40, 2) == 42
@test OC(ci)(40, 2) == 42
end

let ci = code_typed((x, y...)->(x, y), (Int, Int))[1][1]
ir = Core.Compiler.inflate_ir(ci)
@test OC(ir, 2, true)(40, 2) === (40, (2,))
@test OC(ci)(40, 2) === (40, (2,))
end

let ci = code_typed((x, y...)->(x, y), (Int, Int))[1][1]
@test OC(ci)(1, 2) === (1, (2,))
@test_throws MethodError OC(ir, 2, true)(1, 2, 3)
@test_throws MethodError OC(ci)(1, 2, 3)
end

0 comments on commit b22b618

Please sign in to comment.