Skip to content

Commit 06df354

Browse files
committed
added a test for increases code coverage
1 parent a1873c1 commit 06df354

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/spring.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ function iterate(network::Layout{M,P,T}, state) where {M, P, T}
104104
force[i] = force_vec
105105
end
106106
# Cool down
107-
TEMP = initialtemp / state
107+
temp = initialtemp / state
108108
# Now apply them, but limit to temperature
109109
for i = 1:N
110110
force_mag = norm(force[i])
111-
scale = min(force_mag, TEMP)/force_mag
111+
scale = min(force_mag, temp)/force_mag
112112
locs[i] += force[i] * scale
113113
end
114114

test/runtests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ jagmesh_adj = jagmesh()
162162
locs = @time Buchheim.layout(n)
163163
@test typeof(locs) == Vector{Point{2, Float64}}
164164
end
165+
166+
# This testset is to cover a piece of code
167+
# that was not covered anymore after fixing a bug
168+
@testset "Test another Binary tree" begin
169+
tree = [[5, 6], [6], [7, 8], [8], [], [9], [9], [], []]
170+
locs = @time Buchheim.layout(tree)
171+
@test typeof(locs) == Vector{Point{2, Float64}}
172+
end
165173
end
166174

167175
end

0 commit comments

Comments
 (0)