@@ -215,8 +215,12 @@ function test_interpolation_helpers()
215215 U_control = [5.0 6.0 ; 4.0 5.0 ; 3.0 4.0 ] # 3x2 matrix
216216
217217 fu = OCP. build_interpolated_function (
218- U_control, T_control, 2 , Matrix{Float64};
219- expected_dim= 2 , interpolation= :constant
218+ U_control,
219+ T_control,
220+ 2 ,
221+ Matrix{Float64};
222+ expected_dim= 2 ,
223+ interpolation= :constant ,
220224 )
221225
222226 # Test at knots
@@ -262,8 +266,7 @@ function test_interpolation_helpers()
262266 U_1d = [5.0 ; 4.0 ; 3.0 ]
263267
264268 fu = OCP. build_interpolated_function (
265- U_1d, T_1d, 1 , Matrix{Float64};
266- expected_dim= 1 , interpolation= :constant
269+ U_1d, T_1d, 1 , Matrix{Float64}; expected_dim= 1 , interpolation= :constant
267270 )
268271
269272 # Should extract scalar
@@ -291,7 +294,7 @@ function test_interpolation_helpers()
291294 Test. @testset " INTEGRATION: build_solution - piecewise constant control" begin
292295 # 🧪 **Applying Testing Rule**: Integration testing with build_solution
293296 # Create a simple OCP and solution to verify control interpolation behavior
294-
297+
295298 # Build a minimal OCP
296299 pre_ocp = CTModels. PreModel ()
297300 CTModels. time! (pre_ocp; t0= 0.0 , tf= 1.0 )
@@ -314,13 +317,18 @@ function test_interpolation_helpers()
314317 P = [0.0 0.0 ; 0.0 0.0 ; 0.0 0.0 ; 0.0 0.0 ]
315318
316319 sol = CTModels. build_solution (
317- ocp, T, X, U, v, P;
320+ ocp,
321+ T,
322+ X,
323+ U,
324+ v,
325+ P;
318326 objective= 0.5 ,
319327 iterations= 10 ,
320328 constraints_violation= 0.0 ,
321329 message= " test" ,
322330 status= :success ,
323- successful= true
331+ successful= true ,
324332 )
325333
326334 u_func = CTModels. control (sol)
@@ -356,7 +364,7 @@ function test_interpolation_helpers()
356364
357365 Test. @testset " INTEGRATION: build_solution - multi-dimensional constant control" begin
358366 # Test with 2D control to verify vector-valued constant interpolation
359-
367+
360368 pre_ocp = CTModels. PreModel ()
361369 CTModels. time! (pre_ocp; t0= 0.0 , tf= 1.0 )
362370 CTModels. state! (pre_ocp, 2 )
@@ -376,13 +384,18 @@ function test_interpolation_helpers()
376384 P = [0.0 0.0 ; 0.0 0.0 ; 0.0 0.0 ]
377385
378386 sol = CTModels. build_solution (
379- ocp, T, X, U, v, P;
387+ ocp,
388+ T,
389+ X,
390+ U,
391+ v,
392+ P;
380393 objective= 0.5 ,
381394 iterations= 10 ,
382395 constraints_violation= 0.0 ,
383396 message= " test" ,
384397 status= :success ,
385- successful= true
398+ successful= true ,
386399 )
387400
388401 u_func = CTModels. control (sol)
@@ -457,13 +470,18 @@ function test_interpolation_helpers()
457470
458471 # Build solution without specifying control_interpolation (should default to :constant)
459472 sol = CTModels. build_solution (
460- ocp, T, X, U, v, P;
473+ ocp,
474+ T,
475+ X,
476+ U,
477+ v,
478+ P;
461479 objective= 0.5 ,
462480 iterations= 10 ,
463481 constraints_violation= 0.0 ,
464482 message= " test" ,
465483 status= :success ,
466- successful= true
484+ successful= true ,
467485 )
468486
469487 # Verify default is :constant
@@ -499,18 +517,23 @@ function test_interpolation_helpers()
499517 P = [0.0 0.0 ; 0.0 0.0 ; 2.0 0.0 ]
500518
501519 sol = CTModels. build_solution (
502- ocp, T, X, U, v, P;
520+ ocp,
521+ T,
522+ X,
523+ U,
524+ v,
525+ P;
503526 objective= 0.5 ,
504527 iterations= 10 ,
505528 constraints_violation= 0.0 ,
506529 message= " test" ,
507530 status= :success ,
508531 successful= true ,
509- control_interpolation= :constant
532+ control_interpolation= :constant ,
510533 )
511534
512535 Test. @test CTModels. control_interpolation (sol) == :constant
513-
536+
514537 # Verify piecewise constant behavior
515538 u_func = CTModels. control (sol)
516539 Test. @test u_func (0.0 ) ≈ 1.0
@@ -548,18 +571,23 @@ function test_interpolation_helpers()
548571 P = [0.0 0.0 ; 0.0 0.0 ; 2.0 0.0 ]
549572
550573 sol = CTModels. build_solution (
551- ocp, T, X, U, v, P;
574+ ocp,
575+ T,
576+ X,
577+ U,
578+ v,
579+ P;
552580 objective= 0.5 ,
553581 iterations= 10 ,
554582 constraints_violation= 0.0 ,
555583 message= " test" ,
556584 status= :success ,
557585 successful= true ,
558- control_interpolation= :linear
586+ control_interpolation= :linear ,
559587 )
560588
561589 Test. @test CTModels. control_interpolation (sol) == :linear
562-
590+
563591 # Verify piecewise linear behavior
564592 u_func = CTModels. control (sol)
565593 Test. @test u_func (0.0 ) ≈ 1.0
@@ -599,14 +627,19 @@ function test_interpolation_helpers()
599627
600628 # Should throw IncorrectArgument for invalid interpolation type
601629 Test. @test_throws Exceptions. IncorrectArgument CTModels. build_solution (
602- ocp, T, X, U, v, P;
630+ ocp,
631+ T,
632+ X,
633+ U,
634+ v,
635+ P;
603636 objective= 0.5 ,
604637 iterations= 10 ,
605638 constraints_violation= 0.0 ,
606639 message= " test" ,
607640 status= :success ,
608641 successful= true ,
609- control_interpolation= :cubic
642+ control_interpolation= :cubic ,
610643 )
611644 end
612645 end
0 commit comments