Skip to content

Commit cdac6ec

Browse files
committed
Update and reorganize analytical tests
1 parent 201ae62 commit cdac6ec

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

test/utils.jl

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,27 @@ end
2222
@testitem "DifferentiationMethod" setup=[Setup] begin
2323
using MeshIntegrals: _has_analytical, _default_method, _guarantee_analytical
2424

25-
# _has_analytical of instances
26-
triangle = Triangle(Point(0, 0, 0), Point(0, 1, 0), Point(1, 0, 0))
27-
@test _has_analytical(triangle) == true
25+
# Test geometries
2826
sphere = Sphere(Point(0, 0, 0), 1.0)
29-
@test _has_analytical(sphere) == false
27+
triangle = Triangle(Point(0, 0, 0), Point(0, 1, 0), Point(1, 0, 0))
3028

31-
# _default_method
32-
@test _default_method(Meshes.Triangle) isa Analytical
33-
@test _default_method(triangle) isa Analytical
34-
@test _default_method(Meshes.Sphere) isa FiniteDifference
35-
@test _default_method(sphere) isa FiniteDifference
29+
# _has_analytical of instances
30+
@test _has_analytical(sphere) == false
31+
@test _has_analytical(triangle) == true
3632

3733
# _has_analytical of types
38-
@test _has_analytical(Meshes.BezierCurve) == false
39-
@test _has_analytical(Meshes.Line) == true
40-
@test _has_analytical(Meshes.Plane) == true
41-
@test _has_analytical(Meshes.Ray) == true
4234
@test _has_analytical(Meshes.Sphere) == false
43-
@test _has_analytical(Meshes.Tetrahedron) == false
4435
@test _has_analytical(Meshes.Triangle) == true
4536

37+
# _default_method
38+
@test _default_method(Meshes.Sphere) isa FiniteDifference
39+
@test _default_method(sphere) isa FiniteDifference
40+
@test _default_method(Meshes.Triangle) isa Analytical
41+
@test _default_method(triangle) isa Analytical
42+
4643
# _guarantee_analytical
47-
@test _guarantee_analytical(Meshes.Line, Analytical()) === nothing
48-
@test_throws "Analytical" _guarantee_analytical(Meshes.Line, FiniteDifference())
44+
@test _guarantee_analytical(Meshes.Triangle, Analytical()) === nothing
45+
@test_throws "Analytical" _guarantee_analytical(Meshes.Triangle, FiniteDifference())
4946

5047
# FiniteDifference
5148
@test FiniteDifference().ε 1e-6

0 commit comments

Comments
 (0)