Skip to content

Commit e379c0e

Browse files
test: test some ambiguous DiffEqArray constructors
1 parent 222655f commit e379c0e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/interface_tests.jl

+19
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,22 @@ end
279279
zvoa = zero(voa)
280280
@test zvoa.u[1] == zvoa.u[2] == zeros(3)
281281
end
282+
283+
@testset "Issue SciMLBase#889: `DiffEqArray` constructor ambiguity" begin
284+
darr = DiffEqArray([[1.0, 1.0]], [1.0], ())
285+
@test darr.p == ()
286+
@test darr.sys === nothing
287+
@test ndims(darr) == 2
288+
darr = DiffEqArray([[1.0, 1.0]], [1.0], (), "A")
289+
@test darr.p == ()
290+
@test darr.sys == "A"
291+
@test ndims(darr) == 2
292+
darr = DiffEqArray([ones(2, 2)], [1.0], (1, 1, 1))
293+
@test darr.p == (1, 1, 1)
294+
@test darr.sys === nothing
295+
@test ndims(darr) == 3
296+
darr = DiffEqArray([ones(2, 2)], [1.0], (1, 1, 1), "A")
297+
@test darr.p == (1, 1, 1)
298+
@test darr.sys == "A"
299+
@test ndims(darr) == 3
300+
end

0 commit comments

Comments
 (0)