Skip to content

Commit fb9b75c

Browse files
committed
Actually fix tests 1.8+
1 parent 6bd6afe commit fb9b75c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

test/mutualinfo.jl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@ using Clustering
2727
@test mutualinfo(a1, a2; method=:adjusted, aggregate=:max) 0.3437 atol=1.0e-4
2828
@test mutualinfo(a1, a2; method=:adjusted, aggregate=:min) 0.4348 atol=1.0e-4
2929

30-
# test errors
31-
@test_throws "`normed` kwarg is not compatible with `method` kwarg" mutualinfo(a1, a2; method=:adjusted, normed=false)
32-
@test_throws "mutualinfo(): `method=:adjusfted` is not supported" mutualinfo(a1, a2; method=:adjusfted, aggregate=:min)
33-
@test_throws "mutualinfo(): unsupported kwargs used." mutualinfo(a1, a2; method=:adjusted, notaggregate=:min)
34-
@test_throws "mutualinfo(): unsupported kwargs used." mutualinfo(a1, a2; method=:classic, notaggregate=:min)
30+
# test errors. More precise tests on Julia 1.8+ when supported
3531

32+
if VERSION >= v"1.8"
33+
@test_throws "ArgumentError: `normed` kwarg is not compatible with `method` kwarg" mutualinfo(a1, a2; method=:adjusted, normed=false)
34+
@test_throws "ArgumentError: mutualinfo(): `method=:adjusfted` is not supported" mutualinfo(a1, a2; method=:adjusfted, aggregate=:min)
35+
@test_throws "ArgumentError: mutualinfo(): unsupported kwargs used." mutualinfo(a1, a2; method=:adjusted, notaggregate=:min)
36+
@test_throws "ArgumentError: mutualinfo(): unsupported kwargs used." mutualinfo(a1, a2; method=:classic, notaggregate=:min)
37+
else
38+
@test_throws ArgumentError mutualinfo(a1, a2; method=:adjusted, normed=false)
39+
@test_throws ArgumentError mutualinfo(a1, a2; method=:adjusfted, aggregate=:min)
40+
@test_throws ArgumentError mutualinfo(a1, a2; method=:adjusted, notaggregate=:min)
41+
@test_throws ArgumentError mutualinfo(a1, a2; method=:classic, notaggregate=:min)
42+
end
3643
end

0 commit comments

Comments
 (0)