Skip to content

Commit d78e762

Browse files
committed
Remove ugly inline functions
1 parent 16d5510 commit d78e762

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

test/neighborhood_search.jl

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
# This file contains tests for the generic functions in `src/neighborhood_search.jl` and
22
# tests comparing all NHS implementations against the `TrivialNeighborhoodSearch`.
33
@testset verbose=true "Neighborhood Searches" begin
4-
neighborhood_searches = [
5-
(coords, min, max) -> TrivialNeighborhoodSearch{size(coords, 1)}(0.1,
6-
axes(coords, 2),
7-
periodic_box_min_corner = min,
8-
periodic_box_max_corner = max),
9-
(coords, min, max) -> GridNeighborhoodSearch{size(coords, 1)}(0.1, size(coords, 2),
10-
periodic_box_min_corner = min,
11-
periodic_box_max_corner = max),
12-
]
13-
neighborhood_searches_names = [
14-
"`TrivialNeighborhoodSearch`",
15-
"`GridNeighborhoodSearch`",
16-
]
17-
184
@testset verbose=true "Periodicity" begin
195
# These examples are constructed by hand and are therefore a good test for the
206
# trivial neighborhood search as well.
@@ -48,9 +34,22 @@
4834
@testset verbose=true "$(names[i])" for i in eachindex(names)
4935
coords = coordinates[i]
5036

37+
neighborhood_searches = [
38+
TrivialNeighborhoodSearch{size(coords, 1)}(0.1, axes(coords, 2),
39+
periodic_box_min_corner = periodic_boxes[i][1],
40+
periodic_box_max_corner = periodic_boxes[i][2]),
41+
GridNeighborhoodSearch{size(coords, 1)}(0.1, size(coords, 2),
42+
periodic_box_min_corner = periodic_boxes[i][1],
43+
periodic_box_max_corner = periodic_boxes[i][2]),
44+
]
45+
neighborhood_searches_names = [
46+
"`TrivialNeighborhoodSearch`",
47+
"`GridNeighborhoodSearch`",
48+
]
49+
5150
# Run this for every neighborhood search
5251
@testset "$(neighborhood_searches_names[j])" for j in eachindex(neighborhood_searches_names)
53-
nhs = neighborhood_searches[j](coords, periodic_boxes[i]...)
52+
nhs = neighborhood_searches[j]
5453

5554
initialize!(nhs, coords, coords)
5655

0 commit comments

Comments
 (0)