@@ -8,6 +8,8 @@ function ManifoldsBase.default_inverse_retraction_method(::TestPolarManifold)
88end
99
1010struct TestDebugAction <: DebugAction end
11+ Base. show (io:: IO , :: TestDebugAction ) = print (io, " TestDebugAction()" )
12+
1113
1214struct TestMessageState <: AbstractManoptSolverState end
1315Manopt. get_message (:: TestMessageState ) = " DebugTest"
@@ -34,18 +36,25 @@ Manopt.get_parameter(d::TestDebugParameterState, ::Val{:value}) = d.value
3436 )
3537 f (M, q) = distance (M, q, p) .^ 2
3638 grad_f (M, q) = - 2 * log (M, q, p)
37- # summary fallback to show
39+ tda = TestDebugAction ()
40+ # summary fallback to show - inherited from AbstractStateAction(s)
3841 @test Manopt. status_summary (TestDebugAction ()) === " TestDebugAction()"
42+ show (io, tda)
43+ @test String (take! (io)) === " TestDebugAction()"
3944 mp = DefaultManoptProblem (M, ManifoldGradientObjective (f, grad_f))
4045 a1 = DebugDivider (" |" ; io = io)
41- @test Manopt. dispatch_state_decorator (DebugSolverState (st, a1)) === Val {true} ()
46+ dst = DebugSolverState (st, a1)
47+ @test Manopt. dispatch_state_decorator (dst) === Val {true} ()
4248 # constructors
43- @test DebugSolverState (st, a1). debugDictionary[:Iteration ] == a1
44- @test DebugSolverState (st, [a1]). debugDictionary[:Iteration ]. group[1 ] == a1
45- @test DebugSolverState (st, Dict (:A => a1)). debugDictionary[:A ] == a1
46- @test DebugSolverState (st, [" |" ]). debugDictionary[:Iteration ]. divider == a1. divider
47- @test endswith (repr (DebugSolverState (st, a1)), " \" |\" " )
48- @test repr (DebugSolverState (st, Dict {Symbol, DebugAction} ())) == repr (st)
49+ @test DebugSolverState (st, a1). debug_dictionary[:Iteration ] == a1
50+ @test DebugSolverState (st, [a1]). debug_dictionary[:Iteration ]. group[1 ] == a1
51+ @test DebugSolverState (st, Dict (:A => a1)). debug_dictionary[:A ] == a1
52+ @test DebugSolverState (st, [" |" ]). debug_dictionary[:Iteration ]. divider == a1. divider
53+ @test endswith (Manopt. status_summary (dst), " \" |\" " )
54+ @test Manopt. status_summary (a1; inline = true ) == " \" |\" "
55+ @test Manopt. status_summary (a1; inline = false ) == " A Debug printing the String “|” as a divider."
56+ empty_dbg = Dict {Symbol, DebugAction} ()
57+ @test repr (DebugSolverState (st, empty_dbg)) == " DebugSolverState($(repr (st)) , $(repr (empty_dbg)) )"
4958 # Passthrough
5059 dss = DebugSolverState (st, a1)
5160 Manopt. set_parameter! (dss, :StoppingCriterion , :MaxIteration , 20 )
0 commit comments