Skip to content

Commit 74c32bc

Browse files
authored
Support Julia v1.7 (#70)
* Support Julia v1.7 * Update test_layoutarray.jl
1 parent a80c464 commit 74c32bc

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ julia = "1.5"
1414

1515
[extras]
1616
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
17+
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
1718
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1819
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1920

2021
[targets]
21-
test = ["Test", "Random", "Base64"]
22+
test = ["Test", "Random", "Base64", "Compat"]

test/test_layoutarray.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
using ArrayLayouts, LinearAlgebra, Test
22
import ArrayLayouts: sub_materialize
33

4+
if VERSION < v"1.7-"
5+
ColumnNorm() = Val(true)
6+
RowMaximum() = Val(true)
7+
end
8+
49
struct MyMatrix <: LayoutMatrix{Float64}
510
A::Matrix{Float64}
611
end
@@ -83,9 +88,9 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
8388

8489
@testset "factorizations" begin
8590
@test qr(A).factors qr(A.A).factors
86-
@test qr(A,Val(true)).factors qr(A.A,Val(true)).factors
91+
@test qr(A,ColumnNorm()).factors qr(A.A,ColumnNorm()).factors
8792
@test lu(A).factors lu(A.A).factors
88-
@test lu(A,Val(true)).factors lu(A.A,Val(true)).factors
93+
@test lu(A,RowMaximum()).factors lu(A.A,RowMaximum()).factors
8994
@test_throws ErrorException qr!(A)
9095
@test_throws ErrorException lu!(A)
9196

@@ -228,7 +233,9 @@ MemoryLayout(::Type{MyVector}) = DenseColumnMajor()
228233
B = randn(5,5)
229234
= MyMatrix(B)
230235
@test D*D Matrix(D)^2
231-
@test_broken D^2 D*D
236+
if VERSION v"1.7-"
237+
@test D^2 D*D
238+
end
232239
@test D*B Matrix(D)*B
233240
@test B*D B*Matrix(D)
234241
@test D* Matrix(D)*

test/test_layouts.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,10 @@ struct FooNumber <: Number end
351351
@test ArrayLayouts.mul(Eye{Int}(10), Eye(10)) Eye(10)
352352

353353
F = Diagonal(Fill(2,11))
354-
@test ArrayLayouts.mul(F, 1:11) 2:2:22
355-
@test ArrayLayouts.mul(F, Diagonal(1:11)) ArrayLayouts.mul(Diagonal(1:11), F) Diagonal(2:2:22)
354+
@test ArrayLayouts.mul(F, 1:11) isa AbstractRange
355+
@test ArrayLayouts.mul(F, 1:11) == 2:2:22
356+
@test ArrayLayouts.mul(F, Diagonal(1:11)) == ArrayLayouts.mul(Diagonal(1:11), F) == Diagonal(2:2:22)
357+
@test ArrayLayouts.mul(F, Diagonal(1:11)).diag isa AbstractRange
356358
@test ArrayLayouts.mul(F, T) isa Tridiagonal{Int,<:Fill}
357359
@test ArrayLayouts.mul(T, F) isa Tridiagonal{Int,<:Fill}
358360
@test ArrayLayouts.mul(F, T) isa Tridiagonal{Int,<:Fill}

0 commit comments

Comments
 (0)