Skip to content

Commit 5020e2e

Browse files
committed
Fix isapprox tests
1 parent 0c5fc13 commit 5020e2e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

test/problems.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ for PS in (ParticleSwarm, AdaptiveParticleSwarm)
5151
x = [param for (field, param) in pairs]
5252
ackley(x)
5353
end
54-
@test all(isapprox.(params, 0, atol=3)) # analytical solution
54+
@test all(isapprox.(params, 0; atol=3)) # analytical solution
5555
end
5656

5757
@testset "Integer Ackley" begin
@@ -75,7 +75,7 @@ for PS in (ParticleSwarm, AdaptiveParticleSwarm)
7575
ackley(x)
7676
end
7777
true_params = [1., 0., 0., 0., 0., 1., 0., 0., 0., 0.] # analytical solution
78-
@test all(isapprox.(params, true_params, atol=1e-3))
78+
@test all(isapprox.(params, true_params; atol=1e-3))
7979
end
8080

8181
@testset "Mixed Ackley" begin
@@ -89,7 +89,7 @@ for PS in (ParticleSwarm, AdaptiveParticleSwarm)
8989
ackley(x)
9090
end
9191
# Compare with analytical solution
92-
@test isapprox(params[1], 0, atol=1e-3)
92+
@test isapprox(params[1], 0; atol=1e-3)
9393
@test round(params[2]) == 0
9494
@test argmax(params[3:7]) == 1
9595
end

test/strategies/adaptive.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,6 @@ for acceleration in (CPU1(), CPUProcesses(), CPUThreads())
119119

120120
# Compare with random search result with the same settings
121121
@test best_loss < baseline_best_loss ||
122-
isapprox(best_loss, baseline_best_loss, 1e-3)
122+
isapprox(best_loss, baseline_best_loss; atol=1e-3)
123123
end
124124
end

test/strategies/basic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ for acceleration in (CPU1(), CPUProcesses(), CPUThreads())
5858

5959
# Compare with random search result with the same settings
6060
@test best_loss < baseline_best_loss ||
61-
isapprox(best_loss, baseline_best_loss, 1e-3)
61+
isapprox(best_loss, baseline_best_loss; atol=1e-3)
6262
end
6363
end

0 commit comments

Comments
 (0)