Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold authored Dec 1, 2024
1 parent dce7c3a commit 63e85fe
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions test/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,14 @@ end
pt_w = Point(-7, 0, 0)
pt_e = Point(8, 0, 0)
= Vec(0, 0, 1)
triangle = Triangle(pt_n, pt_w, pt_e)
tetrahedron = Tetrahedron(pt_n, pt_w, pt_e, pt_n + ẑ)
triangle = _parametric(Triangle(pt_n, pt_w, pt_e))
tetrahedron = _parametric(Tetrahedron(pt_n, pt_w, pt_e, pt_n +))

# Ensure error is thrown for an out-of-bounds coordinate
for ts in [(-0.5, 0.5), (0.5, -0.5), (1.5, 0.5), (0.5, 1.5)]
@test_throws "not defined" _parametric(triangle, ts...)
# Tetrahedron forwards t1 and t2 to _parametric(::Triangle, ts...)
@test_throws "not defined" _parametric(tetrahedron, ts..., 0)
# Ensure error is thrown for out-of-bounds coordinate
for ts in [(-1, 0), (0, -1), (2, 0), (0, 2)]
@test_throws "not defined" triangle(ts...)
end

# Ensue error is thrown for an out-of-bounds third coordinate
for t3 in [-0.5, 1.5]
@test_throws "not defined" _parametric(tetrahedron, 0, 0, t3)
for ts in [(-1, 0, 0), (0, -1, 0), (0, 0, -1), (2, 0, 0), (0, 2, 0), (0, 0, 2)]
@test_throws "not defined" tetrahedron(ts...)
end
end

0 comments on commit 63e85fe

Please sign in to comment.