File tree Expand file tree Collapse file tree 4 files changed +36
-1
lines changed
GeometryOpsCore/src/types Expand file tree Collapse file tree 4 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ function (Alg::Type{<: SingleManifoldAlgorithm{M}})(m::M; kwargs...) where {M}
71
71
return Alg (; kwargs... )
72
72
end
73
73
74
- function (Alg:: Type{<: ManifoldIndependentAlgorithm {M}} )(m:: Manifold ; kwargs... ) where {M}
74
+ function (Alg:: Type{<: SingleManifoldAlgorithm {M}} )(m:: Manifold ; kwargs... ) where {M}
75
75
# this catches the case where the algorithm doesn't match the manifold
76
76
# throw a WrongManifoldException and be done with it
77
77
throw (WrongManifoldException {typeof(m), M, Alg} ())
Original file line number Diff line number Diff line change
1
+ using GeometryOpsCore
2
+
3
+ @testset " Constructing NoAlgorithm" begin
4
+ @test NoAlgorithm () isa NoAlgorithm
5
+ end
6
+
7
+ @testset " Constructing AutoAlgorithm" begin
8
+ @test AutoAlgorithm () isa AutoAlgorithm
9
+ @test AutoAlgorithm (; x = 1 ) == AutoAlgorithm (AutoManifold (), pairs ((; x = 1 )))
10
+ end
11
+
12
+ @testset " SingleManifoldAlgorithm" begin
13
+ struct TestSMAlgorithm <: SingleManifoldAlgorithm{Planar}
14
+ end
15
+
16
+ @test TestSMAlgorithm () isa TestSMAlgorithm
17
+
18
+ @test_throws GeometryOpsCore. WrongManifoldException TestSMAlgorithm (Geodesic ())
19
+ end
20
+
21
+ @testset " ManifoldIndependentAlgorithm" begin
22
+ struct TestMIDAlgorithm{M} <: ManifoldIndependentAlgorithm{M}
23
+ m:: M
24
+ end
25
+
26
+ @test TestMIDAlgorithm (Planar ()) isa TestMIDAlgorithm
27
+ @test TestMIDAlgorithm (Spherical ()) isa TestMIDAlgorithm
28
+ @test TestMIDAlgorithm (Geodesic ()) isa TestMIDAlgorithm
29
+ end
Original file line number Diff line number Diff line change
1
+ # TODO : test manifold conversion from Geodesic to Spherical and vice versa
Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ using SafeTestsets
4
4
5
5
include (" helpers.jl" )
6
6
7
+ @testset " Core" begin
8
+ @safetestset " Algorithm" begin include (" core/algorithm.jl" ) end
9
+ @safetestset " Manifold" begin include (" core/manifold.jl" ) end
10
+ end
11
+
7
12
@safetestset " Primitives" begin include (" primitives.jl" ) end
8
13
# Methods
9
14
@safetestset " Angles" begin include (" methods/angles.jl" ) end
You can’t perform that action at this time.
0 commit comments