diff --git a/test/threads.jl b/test/threads.jl index 5cf0977a58977..bf387d0c74f00 100644 --- a/test/threads.jl +++ b/test/threads.jl @@ -304,3 +304,9 @@ close(proc.in) end end end + +@testset "bad arguments to @threads" begin + @test_throws ArgumentError @macroexpand(@threads 1 2) # wrong number of args + @test_throws ArgumentError @macroexpand(@threads 1) # arg isn't an Expr + @test_throws ArgumentError @macroexpand(@threads if true 1 end) # arg doesn't start with for +end