Skip to content

Commit 0ef434a

Browse files
committed
More tests for Unsupported
1 parent cce07dd commit 0ef434a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/runtests.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ end # module TestingTypeUtilsWithoutExtensions
1515
module TestingTypeUtils
1616

1717
using TypeUtils
18-
using TypeUtils: BareNumber, BIT_INTEGERS
18+
using TypeUtils: BareNumber, BIT_INTEGERS, Unsupported
1919
using Unitful
2020
using OffsetArrays
2121
using Test
@@ -89,7 +89,12 @@ same_value_and_type(x::T, y::T) where {T} = (x === y) || (x == y)
8989
@testset "TypeUtils" begin
9090
@testset "Miscellaneous" begin
9191
# Check that TypeUtils.Unsupported cannot be instantiated.
92-
@test_throws Exception TypeUtils.Unsupported()
92+
@test_throws Exception Unsupported()
93+
@test Union{Real,Unsupported} <: @inferred Unsupported(Real)
94+
f(x::Unsupported(Integer)) = error("this method is not yet implemented")
95+
@test_throws ErrorException f(8)
96+
f(x::Integer) = x + 1
97+
@test f(8) == 9
9398
end
9499

95100
@testset "parameterless()" begin

0 commit comments

Comments
 (0)