Skip to content

Commit 6e61c75

Browse files
committed
use modules for tests to keep the namespace clean
1 parent 768f8d5 commit 6e61c75

18 files changed

+74
-5
lines changed

test/bicgstabl.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module TestBiCGStabl
2+
13
using IterativeSolvers
24
using Test
35
using Random
@@ -40,3 +42,5 @@ n = 20
4042
end
4143
end
4244
end
45+
46+
end # module

test/cg.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module TestCG
2+
13
using IterativeSolvers
24
using LinearMaps
35
using Test
@@ -93,3 +95,5 @@ end
9395
end
9496

9597
end
98+
99+
end # module

test/chebyshev.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module TestChebyshev
2+
13
using IterativeSolvers
24
using Test
35
using Random
@@ -58,3 +60,5 @@ Random.seed!(1234321)
5860
end
5961
end
6062
end
63+
64+
end # module

test/common.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module TestCommon
2+
13
using Documenter
24
using LinearAlgebra
35
using IterativeSolvers
@@ -29,3 +31,5 @@ end
2931

3032
DocMeta.setdocmeta!(IterativeSolvers, :DocTestSetup, :(using IterativeSolvers); recursive=true)
3133
doctest(IterativeSolvers, manual=false)
34+
35+
end # module

test/gmres.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module TestGMRES
2+
13
using IterativeSolvers
24
using Test
35
using LinearMaps
@@ -70,3 +72,5 @@ end
7072
@test all(x .== b)
7173
end
7274
end
75+
76+
end # module

test/hessenberg.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
module TestHessenberg
2+
3+
using LinearAlgebra
14
using IterativeSolvers
25
using Test
36

@@ -40,3 +43,5 @@ using Test
4043
@test abs(last(solution_with_residual)) norm(H * solution - rhs)
4144
end
4245
end
46+
47+
end # module

test/history.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module TestHistory
2+
13
using IterativeSolvers
24
using RecipesBase
35
using Test
@@ -75,3 +77,5 @@ using Test
7577
end
7678
end
7779
end
80+
81+
end # module

test/idrs.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
module TestIDRs
2+
13
using IterativeSolvers
24
using Test
35
using Random
46
using LinearAlgebra
7+
using SparseArrays
58

69
@testset "IDR(s)" begin
710

@@ -58,3 +61,5 @@ end
5861
end
5962

6063
end
64+
65+
end # module

test/lobpcg.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1+
module TestLOBPCG
2+
13
using IterativeSolvers
24
using LinearMaps
35
using LinearAlgebra
46
using Test
57
using Random
8+
using SparseArrays
9+
610

7-
# Already defined in another file
8-
#=
911
include("laplace_matrix.jl")
1012

1113
struct JacobiPrec{TD}
1214
diagonal::TD
1315
end
1416

15-
Base.ldiv!(y, P::JacobiPrec, x) = y .= x ./ P.diagonal
16-
=#
17+
LinearAlgebra.ldiv!(y, P::JacobiPrec, x) = y .= x ./ P.diagonal
1718

1819
function max_err(R)
1920
r = zeros(real(eltype(R)), size(R, 2))
@@ -358,3 +359,5 @@ end
358359
end
359360
end
360361
end
362+
363+
end # module

test/lsmr.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module TestLSMR
2+
13
using IterativeSolvers
24
using Test
35
using LinearAlgebra
@@ -97,3 +99,5 @@ end
9799
@test norm((A'A + Matrix(Diagonal(v)) .^ 2)x - A'b) 1e-3
98100
end
99101
end
102+
103+
end # module

0 commit comments

Comments
 (0)