|
87 | 87 | @test state.X ≈ hcat(Xs...)
|
88 | 88 | end
|
89 | 89 |
|
90 |
| - # Distributions 0.25.60 broke the tests marked broken below. Comment from @ablaom: I'd |
91 |
| - # say tests that dependend on implementation details of Distributions are not good |
92 |
| - # tests, and these should be replaced by more robust tests in the future. I'm guessing |
93 |
| - # these are really just integration tests. TODO: fix these tests |
94 | 90 | @testset "Retrieve parameters" begin
|
95 | 91 | rng = StableRNG(1234)
|
96 | 92 | ranges = [r1, (r2, Uniform), (r3, d3), r4]
|
97 | 93 | state = PSO.initialize(rng, ranges, n)
|
98 | 94 | PSO.retrieve!(rng, state)
|
99 | 95 | params = state.parameters
|
100 |
| - @test_broken params[1] == ["a", "a", "c"] |
101 |
| - @test params[2] ≈ [553, 250, 375] |
102 |
| - @test_broken @test params[3] ≈ |
103 |
| - [3.9372495283243105, 3.6569395920512977, 3.6354556967115146] |
104 |
| - @test_broken params[4] ≈ [-0.8067647f0, 0.4209916f0, 0.6736019f0] |
| 96 | + @test params[1] isa AbstractVector{<:AbstractString} |
| 97 | + @test params[2] isa AbstractVector{<:Integer} |
| 98 | + @test params[3] isa AbstractVector{<:AbstractFloat} |
| 99 | + @test params[4] isa AbstractVector{<:AbstractFloat} |
| 100 | + @test length(params[4]) == 3 |
| 101 | + @test all(params) do p |
| 102 | + length(p) == n |
| 103 | + end |
105 | 104 | end
|
106 | 105 | end
|
0 commit comments