Skip to content

Commit 71d5210

Browse files
committed
Test ismutable for wrapped arrays
1 parent 7c49f8e commit 71d5210

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/runtests.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ import ArrayInterface: has_sparsestruct, findstructralnz, fast_scalar_indexing,
44
@test ArrayInterface.ismutable(rand(3))
55

66
using StaticArrays
7-
@test ArrayInterface.ismutable(@SVector [1,2,3]) == false
8-
@test ArrayInterface.ismutable(@MVector [1,2,3]) == true
7+
x = @SVector [1,2,3]
8+
@test ArrayInterface.ismutable(x) == false
9+
@test ArrayInterface.ismutable(view(x, 1:2)) == false
10+
x = @MVector [1,2,3]
11+
@test ArrayInterface.ismutable(x) == true
12+
@test ArrayInterface.ismutable(view(x, 1:2)) == true
913
@test ArrayInterface.ismutable(1:10) == false
1014
@test ArrayInterface.ismutable((0.1,1.0)) == false
1115
@test ArrayInterface.ismutable(Base.ImmutableDict{Symbol,Int64}) == false
1216
@test ArrayInterface.ismutable((;x=1)) == false
17+
1318
@test isone(ArrayInterface.known_first(typeof(StaticArrays.SOneTo(7))))
1419
@test ArrayInterface.known_last(typeof(StaticArrays.SOneTo(7))) == 7
1520
@test ArrayInterface.known_length(typeof(StaticArrays.SOneTo(7))) == 7

0 commit comments

Comments
 (0)