Skip to content

Commit 5448350

Browse files
committed
Restrict test to version v1.11
1 parent 77bfc17 commit 5448350

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/test_layoutarray.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct MyVector{T} <: LayoutVector{T}
2222
A::Vector{T}
2323
end
2424

25+
MyVector(M::MyVector) = MyVector(M.A)
2526
Base.getindex(A::MyVector, k::Int) = A.A[k]
2627
Base.setindex!(A::MyVector, v, k::Int) = setindex!(A.A, v, k)
2728
Base.size(A::MyVector) = size(A.A)
@@ -30,6 +31,7 @@ Base.elsize(::Type{MyVector}) = sizeof(Float64)
3031
Base.cconvert(::Type{Ptr{T}}, A::MyVector{T}) where {T} = A.A
3132
Base.unsafe_convert(::Type{Ptr{T}}, A::MyVector{T}) where T = Base.unsafe_convert(Ptr{T}, A.A)
3233
MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
34+
Base.copy(A::MyVector) = MyVector(copy(A.A))
3335

3436
# These need to test dispatch reduces to ArrayLayouts.mul, etc.
3537
@testset "LayoutArray" begin
@@ -151,7 +153,7 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
151153
@test_throws MethodError ldiv!(qr(A), MyVector(copy(c)))
152154
end
153155
@test_throws ErrorException ldiv!(eigen(randn(5,5)), c)
154-
@test ArrayLayouts.ldiv!(svd(A.A), copy(c)) ArrayLayouts.ldiv!(similar(c), svd(A.A), c) A \ c
156+
@test ArrayLayouts.ldiv!(svd(A.A), Vector(c)) ArrayLayouts.ldiv!(similar(c), svd(A.A), c) A \ c
155157
if VERSION v"1.8"
156158
@test ArrayLayouts.ldiv!(similar(c), transpose(lu(A.A)), copy(c)) A'\c
157159
end
@@ -344,8 +346,10 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
344346
S = SymTridiagonal(map(MyVector, (rand(n), rand(n-1)))...)
345347
T = Tridiagonal(map(MyVector, (rand(n-1), rand(n), rand(n-1)))...)
346348
DA, BA, SA, TA = map(Array, (D, B, S, T))
347-
@test D * B DA * BA
348-
@test B * D BA * DA
349+
if VERSION >= v"1.11"
350+
@test D * B DA * BA
351+
@test B * D BA * DA
352+
end
349353
if VERSION >= v"1.12.0-DEV.824"
350354
@test D * S DA * SA
351355
@test D * T DA * TA
@@ -416,7 +420,7 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
416420

417421
@testset "dot" begin
418422
a = MyVector(randn(5))
419-
@test dot(a, Zeros(5)) dot(Zeros(5), a) 0.0
423+
@test dot(a, Zeros(5)) dot(Zeros(5), a) == 0.0
420424
end
421425

422426
@testset "layout_getindex scalar" begin

0 commit comments

Comments
 (0)