Skip to content

Commit fe278d9

Browse files
committed
add tests
1 parent 7805485 commit fe278d9

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/verbosity.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using LinearSolve
2+
using LinearSolve: LinearVerbosity
3+
using SciMLLogging: SciMLLogging, Verbosity
4+
using Test
5+
6+
A = [1.0 0 0 0
7+
0 1 0 0
8+
0 0 1 0
9+
0 0 0 0]
10+
b = rand(4)
11+
prob = LinearProblem(A, b)
12+
13+
@test_logs (:warn,
14+
"LU factorization failed, falling back to QR factorization. `A` is potentially rank-deficient.") solve(
15+
prob,
16+
verbose = LinearVerbosity(default_lu_fallback = Verbosity.Warn()))
17+
18+
@test_logs (:warn,
19+
"LU factorization failed, falling back to QR factorization. `A` is potentially rank-deficient.") solve(
20+
prob, verbose = true)
21+
22+
@test_logs min_level=SciMLLogging.Logging.Warn solve(prob, verbose = false)
23+
24+
@test_logs (:info,
25+
"LU factorization failed, falling back to QR factorization. `A` is potentially rank-deficient.") solve(
26+
prob,
27+
verbose = LinearVerbosity(default_lu_fallback = Verbosity.Info()))

0 commit comments

Comments
 (0)