45
45
46
46
@testset " docstring" begin
47
47
@test docstring (Foo (1 ,' x' )) == " Foo"
48
- @test docstring (Fruit. RedApple ()) == " Main.Fruit.RedApple"
48
+ @test docstring (Fruit. RedApple (4 )) == " Main.Fruit.RedApple{Int64} "
49
49
end
50
50
51
51
@testset " hyperparameter_ranges" begin
52
52
@test hyperparameter_ranges (Foo (1 , ' x' )) == (nothing , nothing )
53
- @test hyperparameter_ranges (Fruit. RedApple ()) == ()
53
+ @test hyperparameter_ranges (Fruit. RedApple (4 )) == (nothing , )
54
54
end
55
55
56
56
@testset " name" begin
57
57
@test name (Float64) == " Float64"
58
58
@test name (Fruit. RedApple) == " RedApple"
59
- @test name (Fruit. RedApple ()) == " RedApple"
59
+ @test name (Fruit. RedApple (4 )) == " RedApple"
60
60
end
61
61
62
62
@testset " human_name" begin
63
63
@test human_name (AbstractString) == " abstract string"
64
64
@test human_name (Fruit. RedApple) == " red apple"
65
- @test human_name (Fruit. RedApple ()) == " red apple"
65
+ @test human_name (Fruit. RedApple (4 )) == " red apple"
66
66
end
67
67
68
68
@testset " hyperparameters" begin
69
69
@test hyperparameters (Foo (1 , ' x' )) == (:x , :y )
70
- @test hyperparameters (Fruit. RedApple ()) == ()
70
+ @test hyperparameters (Fruit. RedApple (4 )) == (:x , )
71
71
end
72
72
73
73
@testset " hyperparameter_types" begin
74
74
@test hyperparameter_types (Foo (1 , ' x' )) == (" Int64" , " Char" )
75
- @test hyperparameter_types (Fruit. RedApple ()) == ()
75
+ @test hyperparameter_types (Fruit. RedApple (4 )) == (" Int64 " , )
76
76
end
77
77
78
78
@@ -88,7 +88,7 @@ const NONCONSTANT = [:docstring,
88
88
@testset " traits with constant fall-back" begin
89
89
for trait in setdiff (StatisticalTraits. TRAITS, NONCONSTANT)
90
90
ex = quote
91
- a = $ trait (Fruit. RedApple ())
91
+ a = $ trait (Fruit. RedApple (4 ))
92
92
b = $ trait (Foo (1 , ' x' ))
93
93
if ismissing (a)
94
94
@test ismissing (b)
0 commit comments