Skip to content

Commit

Permalink
Modify test to verify shifted axes
Browse files Browse the repository at this point in the history
  • Loading branch information
darwindarak committed Jun 28, 2014
1 parent 438158d commit 370bcf7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/verify_vertices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ using ImmutableArrays
# using Grid

# Setup test axes that will be shared among the tests

# Shift the axes so that they do not line up with
# integer values
Δ = 0.01
X = [-2:Δ:2]
Y = [-3:Δ:3]
X = [0:Δ:4] + π
Y = [0:Δ:3] + φ

# TEST CASE 1
#
Expand All @@ -16,7 +19,7 @@ h = (Δ + (3 - Δ)rand())
contourlevels = Contour.contour(X,Y,Z, h)
for line in contourlevels.lines
for v in line.vertices
@test_approx_eq_eps (v[1]^2 + v[2]^2 ) h 0.1Δ
@test_approx_eq_eps ((v[1] - π)^2 + (v[2] - φ)^2 ) h 0.1Δ
end
end

Expand Down

0 comments on commit 370bcf7

Please sign in to comment.