118118 prob, verbose = NonlinearVerbosity (threshold_state = SciMLLogging. InfoLevel ()))
119119
120120 @test cache. verbose. threshold_state == SciMLLogging. InfoLevel ()
121- end
121+
122+ f (u, p) = u .* u .- 2
123+ prob = NonlinearProblem (f, [1.0 , 1.0 ])
124+
125+ @testset " solve with Bool verbose" begin
126+ # Test verbose = true works (default verbosity)
127+ sol1 = solve (prob, verbose = true )
128+ @test sol1. retcode == ReturnCode. Success
129+
130+ # Test verbose = false silences all output
131+ @test_logs min_level= 0 sol2= solve (prob, verbose = false )
132+ end
133+
134+ @testset " solve with Preset verbose" begin
135+ # Test verbose = SciMLLogging.Standard() works
136+ sol1 = solve (prob, verbose = SciMLLogging. Standard ())
137+ @test sol1. retcode == ReturnCode. Success
138+
139+ # Test verbose = SciMLLogging.None() silences output
140+ @test_logs min_level= 0 sol2= solve (prob, verbose = SciMLLogging. None ())
141+
142+ # Test verbose = SciMLLogging.Detailed() works
143+ sol3 = solve (prob, verbose = SciMLLogging. Detailed ())
144+ @test sol3. retcode == ReturnCode. Success
145+
146+ # Test verbose = SciMLLogging.All() works
147+ sol4 = solve (prob, verbose = SciMLLogging. All ())
148+ @test sol4. retcode == ReturnCode. Success
149+
150+ # Test verbose = SciMLLogging.Minimal() works
151+ sol5 = solve (prob, verbose = SciMLLogging. Minimal ())
152+ @test sol5. retcode == ReturnCode. Success
153+ end
154+
155+ @testset " init with Bool verbose" begin
156+ # Test verbose = true converts to NonlinearVerbosity()
157+ cache1 = init (prob, verbose = true )
158+ @test cache1. verbose isa NonlinearVerbosity
159+ @test cache1. verbose. threshold_state == SciMLLogging. WarnLevel ()
160+
161+ # Test verbose = false converts to NonlinearVerbosity(None())
162+ cache2 = init (prob, verbose = false )
163+ @test cache2. verbose isa NonlinearVerbosity
164+ @test cache2. verbose. threshold_state isa SciMLLogging. Silent
165+ @test cache2. verbose. non_enclosing_interval isa SciMLLogging. Silent
166+ end
167+
168+ @testset " init with Preset verbose" begin
169+ # Test verbose = SciMLLogging.Standard() converts to NonlinearVerbosity(Standard())
170+ cache1 = init (prob, verbose = SciMLLogging. Standard ())
171+ @test cache1. verbose isa NonlinearVerbosity
172+ @test cache1. verbose. threshold_state == SciMLLogging. WarnLevel ()
173+
174+ # Test verbose = SciMLLogging.None() converts to NonlinearVerbosity(None())
175+ cache2 = init (prob, verbose = SciMLLogging. None ())
176+ @test cache2. verbose isa NonlinearVerbosity
177+ @test cache2. verbose. threshold_state isa SciMLLogging. Silent
178+
179+ # Test verbose = SciMLLogging.Detailed()
180+ cache3 = init (prob, verbose = SciMLLogging. Detailed ())
181+ @test cache3. verbose isa NonlinearVerbosity
182+ @test cache3. verbose. linear_verbosity isa SciMLLogging. Detailed
183+
184+ # Test verbose = SciMLLogging.All()
185+ cache4 = init (prob, verbose = SciMLLogging. All ())
186+ @test cache4. verbose isa NonlinearVerbosity
187+ @test cache4. verbose. threshold_state == SciMLLogging. InfoLevel ()
188+
189+ # Test verbose = SciMLLogging.Minimal()
190+ cache5 = init (prob, verbose = SciMLLogging. Minimal ())
191+ @test cache5. verbose isa NonlinearVerbosity
192+ @test cache5. verbose. alias_u0_immutable isa SciMLLogging. Silent
193+ end
194+
195+ @testset " init then solve with converted verbose" begin
196+ # Ensure the converted verbose works through the full solve pipeline
197+ cache = init (prob, verbose = false )
198+ @test_logs min_level= 0 sol= solve! (cache)
199+ end
200+ end
0 commit comments