Skip to content

Commit 591f066

Browse files
authored
Move sparse matrix tests to the new SparseArrays.jl repo (#43832)
* Move sparse matrix tests to the new SparseArrays.jl repo
1 parent f03e839 commit 591f066

File tree

5 files changed

+5
-83
lines changed

5 files changed

+5
-83
lines changed

test/abstractarray.jl

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3-
using Random, LinearAlgebra, SparseArrays
3+
using Random, LinearAlgebra
44

55
A = rand(5,4,3)
66
@testset "Bounds checking" begin
@@ -832,24 +832,6 @@ A = TSlowNIndexes(rand(2,2))
832832
@test @inferred(axes(rand(3,2), 3)) == 1:1
833833
end
834834

835-
@testset "#17088" begin
836-
n = 10
837-
M = rand(n, n)
838-
@testset "vector of vectors" begin
839-
v = [[M]; [M]] # using vcat
840-
@test size(v) == (2,)
841-
@test !issparse(v)
842-
end
843-
@testset "matrix of vectors" begin
844-
m1 = [[M] [M]] # using hcat
845-
m2 = [[M] [M];] # using hvcat
846-
@test m1 == m2
847-
@test size(m1) == (1,2)
848-
@test !issparse(m1)
849-
@test !issparse(m2)
850-
end
851-
end
852-
853835
@testset "isinteger and isreal" begin
854836
@test all(isinteger, Diagonal(rand(1:5,5)))
855837
@test isreal(Diagonal(rand(5)))
@@ -1022,7 +1004,6 @@ end
10221004
s = Vector([1, 2])
10231005
for a = ([1], UInt[1], [3, 4, 5], UInt[3, 4, 5])
10241006
@test s === copy!(s, Vector(a)) == Vector(a)
1025-
@test s === copy!(s, SparseVector(a)) == Vector(a)
10261007
end
10271008
# issue #35649
10281009
s = [1, 2, 3, 4]

test/arrayops.jl

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ using .Main.OffsetArrays
66

77
isdefined(@__MODULE__, :T24Linear) || include("testhelpers/arrayindexingtypes.jl")
88

9-
using SparseArrays
10-
119
using Random, LinearAlgebra
1210
using Dates
1311

@@ -1201,9 +1199,6 @@ end
12011199
m = mapslices(x->tuple(x), [1 2; 3 4], dims=1)
12021200
@test m[1,1] == ([1,3],)
12031201
@test m[1,2] == ([2,4],)
1204-
1205-
# issue #21123
1206-
@test mapslices(nnz, sparse(1.0I, 3, 3), dims=1) == [1 1 1]
12071202
end
12081203

12091204
@testset "single multidimensional index" begin
@@ -1954,13 +1949,6 @@ end
19541949
@test isless(CartesianIndex((2,1)), CartesianIndex((1,2)))
19551950
@test !isless(CartesianIndex((1,2)), CartesianIndex((2,1)))
19561951

1957-
a = spzeros(2,3)
1958-
@test CartesianIndices(size(a)) == eachindex(a)
1959-
a[CartesianIndex{2}(2,3)] = 5
1960-
@test a[2,3] == 5
1961-
b = view(a, 1:2, 2:3)
1962-
b[CartesianIndex{2}(1,1)] = 7
1963-
@test a[1,2] == 7
19641952
@test 2*CartesianIndex{3}(1,2,3) == CartesianIndex{3}(2,4,6)
19651953
@test CartesianIndex{3}(1,2,3)*2 == CartesianIndex{3}(2,4,6)
19661954
@test_throws ErrorException iterate(CartesianIndex{3}(1,2,3))
@@ -2013,16 +2001,6 @@ end
20132001
y = iterate(itr, y[2])
20142002
@test y === nothing
20152003
@test r[val] == 3
2016-
r = sparse(2:3:8)
2017-
itr = eachindex(r)
2018-
y = iterate(itr)
2019-
@test y !== nothing
2020-
y = iterate(itr, y[2])
2021-
y = iterate(itr, y[2])
2022-
@test y !== nothing
2023-
val, state = y
2024-
@test r[val] == 8
2025-
@test iterate(itr, state) == nothing
20262004
end
20272005

20282006
R = CartesianIndices((1,3))
@@ -2964,18 +2942,3 @@ end
29642942
@test c + zero(c) == c
29652943
end
29662944
end
2967-
2968-
@testset "Allow assignment of singleton array to sparse array #43644" begin
2969-
K = spzeros(3,3)
2970-
b = zeros(3,3)
2971-
b[3,:] = [1,2,3]
2972-
K[3,1:3] += [1.0 2.0 3.0]'
2973-
@test K == b
2974-
K[3:3,1:3] += zeros(1, 3)
2975-
@test K == b
2976-
K[3,1:3] += zeros(3)
2977-
@test K == b
2978-
K[3,:] += zeros(3,1)
2979-
@test K == b
2980-
@test_throws DimensionMismatch K[3,1:2] += [1.0 2.0 3.0]'
2981-
end

test/core.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# test core language features
44

5-
using Random, SparseArrays, InteractiveUtils
5+
using Random, InteractiveUtils
66

77
const Bottom = Union{}
88

@@ -3659,7 +3659,7 @@ f12092(x::Int, y::Int...) = 2
36593659
# NOTE: should have > MAX_TUPLETYPE_LEN arguments
36603660
f12063(tt, g, p, c, b, v, cu::T, d::AbstractArray{T, 2}, ve) where {T} = 1
36613661
f12063(args...) = 2
3662-
g12063() = f12063(0, 0, 0, 0, 0, 0, 0.0, spzeros(0,0), Int[])
3662+
g12063() = f12063(0, 0, 0, 0, 0, 0, 0.0, zeros(0,0), Int[])
36633663
@test g12063() == 1
36643664

36653665
# issue #11587

test/hashing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,4 +283,4 @@ end
283283
@test isequal(a, b) == (Base.hash_32_32(a) == Base.hash_32_32(b))
284284
end
285285
end
286-
end
286+
end

test/show.jl

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3-
using LinearAlgebra, SparseArrays
3+
using LinearAlgebra
44

55
# For curmod_*
66
include("testenv.jl")
@@ -730,28 +730,6 @@ let filename = tempname()
730730
rm(filename)
731731
end
732732

733-
# issue #12960
734-
mutable struct T12960 end
735-
import Base.zero
736-
Base.zero(::Type{T12960}) = T12960()
737-
Base.zero(x::T12960) = T12960()
738-
let
739-
A = sparse(1.0I, 3, 3)
740-
B = similar(A, T12960)
741-
@test repr(B) == "sparse([1, 2, 3], [1, 2, 3], $T12960[#undef, #undef, #undef], 3, 3)"
742-
@test occursin(
743-
"\n #undef ⋅ ⋅ \n ⋅ #undef ⋅ \n ⋅ ⋅ #undef",
744-
repr(MIME("text/plain"), B),
745-
)
746-
747-
B[1,2] = T12960()
748-
@test repr(B) == "sparse([1, 1, 2, 3], [1, 2, 2, 3], $T12960[#undef, $T12960(), #undef, #undef], 3, 3)"
749-
@test occursin(
750-
"\n #undef T12960() ⋅ \n ⋅ #undef ⋅ \n ⋅ ⋅ #undef",
751-
repr(MIME("text/plain"), B),
752-
)
753-
end
754-
755733
# issue #13127
756734
function f13127()
757735
buf = IOBuffer()

0 commit comments

Comments
 (0)