From 928eb439e4e0e0bc87433abddcdc9000cc24a058 Mon Sep 17 00:00:00 2001 From: Sukera Date: Sun, 13 Aug 2023 10:35:49 +0200 Subject: [PATCH] Add test for type stability using `@inferred` --- test/runtests.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index 42f6e51..af1eb64 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -406,4 +406,12 @@ const numTypes = union(getSubtypes(Integer), getSubtypes(AbstractFloat)) end == 2 end end + @testset "Inference" begin + @testset for gen in ( + itype(Int8), PropCheck.iposint(Int8), PropCheck.inegint(Int8), + PropCheck.ifloat(Float16), PropCheck.ifloatinf(Float16), PropCheck.ifloatnan(Float16), + ) + @test @inferred(generate(gen)) isa PropCheck.Tree + end + end end