@@ -27,10 +27,17 @@ using Clustering
27
27
@test mutualinfo (a1, a2; method= :adjusted , aggregate= :max ) ≈ 0.3437 atol= 1.0e-4
28
28
@test mutualinfo (a1, a2; method= :adjusted , aggregate= :min ) ≈ 0.4348 atol= 1.0e-4
29
29
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
35
31
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
36
43
end
0 commit comments