Skip to content

Commit c1ce4c1

Browse files
test: add CA test
1 parent 90fc351 commit c1ce4c1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/ArrayInterface.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ ensures_sorted(@nospecialize( T::Type{<:AbstractRange})) = true
10001000
ensures_sorted(T::Type) = is_forwarding_wrapper(T) ? ensures_sorted(parent_type(T)) : false
10011001
ensures_sorted(@nospecialize(x)) = ensures_sorted(typeof(x))
10021002

1003-
function has_trivial_array_contstructor(::Type{T}, args...) where T
1003+
function has_trivial_array_constructor(::Type{T}, args...) where T
10041004
applicable(convert, T, args...)
10051005
end
10061006

test/core.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ using ArrayInterface
22
using ArrayInterface: zeromatrix, undefmatrix
33
import ArrayInterface: has_sparsestruct, findstructralnz, fast_scalar_indexing, lu_instance,
44
parent_type, zeromatrix
5+
using ComponentArrays
56
using LinearAlgebra
67
using Random
78
using SparseArrays
@@ -289,4 +290,9 @@ end
289290
end
290291
@test ArrayInterface.ldlt_instance(SymTridiagonal(A' * A)) isa typeof(ldlt(SymTridiagonal(A' * A)))
291292
end
292-
end
293+
end
294+
295+
@testset "Array conversion" begin
296+
cv = ComponentVector((x = rand(3), y = rand(3)))
297+
@test ArrayInterface.has_trivial_array_constructor(typeof(cv), rand(6))
298+
end

0 commit comments

Comments
 (0)