File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -157,20 +157,28 @@ end
157
157
@mlj_model mutable struct Foo1
158
158
a:: Vector{Int} = [1 , 2 , 3 ]
159
159
end
160
- Foo1 (). a == [1 , 2 , 3 ]
160
+ @test Foo1 (). a == [1 , 2 , 3 ]
161
161
@mlj_model mutable struct Foo2
162
162
a:: Vector{Int} = [1 , 2 , 3 ]:: (true)
163
163
end
164
- Foo2 (). a == [1 , 2 , 3 ]
164
+ @test Foo2 (). a == [1 , 2 , 3 ]
165
165
166
- # Negative number:
166
+ # Constraints applied
167
167
@mlj_model mutable struct Foo3
168
- a:: Float64 = - 1.0
168
+ a:: Vector{Int} = [ 1 , 2 , 3 ] :: (all(>(0) , _))
169
169
end
170
- Foo3 (). a === - 1.0
170
+ @test redirect_stderr (devnull ) do
171
+ Foo3 (; a = [- 1 ]). a == [1 , 2 , 3 ]
172
+ end
173
+
174
+ # Negative number:
171
175
@mlj_model mutable struct Foo4
176
+ a:: Float64 = - 1.0
177
+ end
178
+ @test Foo4 (). a === - 1.0
179
+ @mlj_model mutable struct Foo5
172
180
a:: Float64 = (- 1.0 ):: (true)
173
181
end
174
- Foo4 (). a == - 1.0
182
+ @test Foo5 (). a == - 1.0
175
183
176
184
end
You can’t perform that action at this time.
0 commit comments