@@ -49,12 +49,11 @@ function test_solve_dispatch()
4949 registry = OptimalControl. get_strategy_registry ()
5050
5151 # ====================================================================
52- # CONTRACT TESTS - ExplicitMode : complete components (mock Layer 3)
52+ # CONTRACT TESTS - solve_explicit : complete components (mock Layer 3)
5353 # ====================================================================
5454
55- Test. @testset " ExplicitMode - all three components" begin
56- result = OptimalControl. _solve (
57- OptimalControl. ExplicitMode (),
55+ Test. @testset " solve_explicit - all three components" begin
56+ result = OptimalControl. solve_explicit (
5857 ocp;
5958 initial_guess= init,
6059 display= false ,
@@ -65,13 +64,12 @@ function test_solve_dispatch()
6564 end
6665
6766 # ====================================================================
68- # CONTRACT TESTS - DescriptiveMode : stub raises NotImplemented
67+ # CONTRACT TESTS - solve_descriptive : stub raises NotImplemented
6968 # ====================================================================
7069
71- Test. @testset " DescriptiveMode - raises NotImplemented" begin
70+ Test. @testset " solve_descriptive - raises NotImplemented" begin
7271 Test. @test_throws CTBase. NotImplemented begin
73- OptimalControl. _solve (
74- OptimalControl. DescriptiveMode (),
72+ OptimalControl. solve_descriptive (
7573 ocp, :collocation , :adnlp , :ipopt ;
7674 initial_guess= init,
7775 display= false ,
@@ -80,65 +78,20 @@ function test_solve_dispatch()
8078 end
8179 end
8280
83- Test. @testset " DescriptiveMode - empty description raises NotImplemented" begin
81+ Test. @testset " solve_descriptive - empty description raises NotImplemented" begin
8482 Test. @test_throws CTBase. NotImplemented begin
85- OptimalControl. _solve (
86- OptimalControl. DescriptiveMode (),
83+ OptimalControl. solve_descriptive (
8784 ocp;
8885 initial_guess= init,
8986 display= false ,
9087 registry= registry
9188 )
9289 end
9390 end
94-
95- # ====================================================================
96- # CONTRACT TESTS - Dispatch correctness
97- # ====================================================================
98-
99- Test. @testset " Dispatch correctness - ExplicitMode route" begin
100- # Verify that ExplicitMode actually routes to the ExplicitMode method
101- function _dispatch_route (mode:: OptimalControl.ExplicitMode )
102- return :explicit
103- end
104- function _dispatch_route (mode:: OptimalControl.DescriptiveMode )
105- return :descriptive
106- end
107-
108- Test. @test _dispatch_route (OptimalControl. ExplicitMode ()) == :explicit
109- end
110-
111- Test. @testset " Dispatch correctness - DescriptiveMode route" begin
112- # Verify that DescriptiveMode actually routes to the DescriptiveMode method
113- function _dispatch_route (mode:: OptimalControl.ExplicitMode )
114- return :explicit
115- end
116- function _dispatch_route (mode:: OptimalControl.DescriptiveMode )
117- return :descriptive
118- end
119-
120- Test. @test _dispatch_route (OptimalControl. DescriptiveMode ()) == :descriptive
121- end
122-
123- # ====================================================================
124- # INTEGRATION TESTS - End-to-end dispatch
125- # ====================================================================
126-
127- Test. @testset " Integration - complete explicit workflow" begin
128- result = OptimalControl. _solve (
129- OptimalControl. ExplicitMode (),
130- ocp;
131- initial_guess= init,
132- display= false ,
133- registry= registry,
134- discretizer= disc, modeler= mod, solver= sol
135- )
136- Test. @test result isa MockSolution
137- end
13891 end
13992end
14093
14194end # module
14295
14396# CRITICAL: Redefine in outer scope for TestRunner
144- test_solve_dispatch () = TestSolveDispatch. test_solve_dispatch ()
97+ test_dispatch () = TestSolveDispatch. test_solve_dispatch ()
0 commit comments