Skip to content

Commit f240686

Browse files
committed
Do not @Assert in tests, @test instead
1 parent 76d2f20 commit f240686

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/test_PSs.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,23 +257,23 @@ for i in 1:2
257257
for s in 1:size(c,1)-1
258258
GMT._blp_seg2cross(x1,y1_,x2,y2_, c[s,1],c[s,2], c[s+1,1],c[s+1,2]) && (crossings += 1)
259259
end
260-
@assert crossings >= 1 "Crossing segment for curve $i does not cross the curve"
260+
@test crossings >= 1 "Crossing segment for curve $i does not cross the curve"
261261
end
262262

263263
# 3) X-crossing lines: labels should NOT be near each other
264264
Dx = mat2ds([[0.0 0; 4 4], [0.0 4; 4 0]])
265265
bx = GMT.best_label_pos(Dx, ["up", "down"])
266266
dist = hypot(bx[1,1]-bx[2,1], bx[1,2]-bx[2,2])
267-
@assert dist > 0.3 "Labels on X-crossing lines are too close: $dist"
267+
@test dist > 0.3 "Labels on X-crossing lines are too close: $dist"
268268

269269
# 4) prefer=:begin puts labels in first half, prefer=:end in second half
270270
Dlong = mat2ds([Float64[i for i in 0:20] Float64[sin(i/3) for i in 0:20]])
271271
bb = GMT.best_label_pos(Dlong, ["wave"]; prefer=:begin)
272272
be = GMT.best_label_pos(Dlong, ["wave"]; prefer=:end)
273273
mid_x = (bb[1,1]+bb[1,3])/2 # midpoint of crossing segment
274274
mid_xe = (be[1,1]+be[1,3])/2
275-
@assert mid_x < 10 "prefer=:begin label not in first half (x=$mid_x)"
276-
@assert mid_xe > 10 "prefer=:end label not in second half (x=$mid_xe)"
275+
@test mid_x < 10 "prefer=:begin label not in first half (x=$mid_x)"
276+
@test mid_xe > 10 "prefer=:end label not in second half (x=$mid_xe)"
277277

278278
# 5) Single curve (GMTdataset, not vector)
279279
Ds = mat2ds([0.0 0; 1 1; 2 0; 3 1; 4 0])

0 commit comments

Comments
 (0)