Skip to content

update and fix tests #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/partitions_test.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using RecursiveArrayTools, Test, Statistics, ArrayInterfaceCore
using RecursiveArrayTools, Test, Statistics, ArrayInterface
A = (rand(5), rand(5))
p = ArrayPartition(A)
@test (p.x[1][1], p.x[2][1]) == (p[1], p[6])
Expand Down Expand Up @@ -190,7 +190,7 @@ up = ap .+ 1
up = 2 .* ap .+ 1
@test typeof(ap) == typeof(up)

@testset "ArrayInterfaceCore.ismutable(ArrayPartition($a, $b)) == $r" for (a, b, r) in ((1,
@testset "ArrayInterface.ismutable(ArrayPartition($a, $b)) == $r" for (a, b, r) in ((1,
2,
false),
([
Expand All @@ -205,7 +205,7 @@ up = 2 .* ap .+ 1
2,
],
true))
@test ArrayInterfaceCore.ismutable(ArrayPartition(a, b)) == r
@test ArrayInterface.ismutable(ArrayPartition(a, b)) == r
end

# Test unary minus
Expand Down
10 changes: 5 additions & 5 deletions test/upstream.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using OrdinaryDiffEq, NLsolve, RecursiveArrayTools, Test, ArrayInterfaceCore
using OrdinaryDiffEq, NLsolve, RecursiveArrayTools, Test, ArrayInterface
function lorenz(du, u, p, t)
du[1] = 10.0 * (u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
du[3] = u[1] * u[2] - (8 / 3) * u[3]
end
u0 = ArrayPartition([1.0, 0.0], [0.0])
@test ArrayInterfaceCore.zeromatrix(u0) isa Matrix
@test ArrayInterface.zeromatrix(u0) isa Matrix
tspan = (0.0, 100.0)
prob = ODEProblem(lorenz, u0, tspan)
sol = solve(prob, Tsit5())
Expand Down Expand Up @@ -39,16 +39,16 @@ end
@test solve(ODEProblem(dyn,
ArrayPartition(ArrayPartition(zeros(1), [-1.0]),
ArrayPartition(zeros(1), [0.75])),
(0.0, 1.0)), AutoTsit5(Rodas5())).retcode == :Success
(0.0, 1.0)), AutoTsit5(Rodas5())).retcode == ReturnCode.Success

if VERSION < v"1.7"
@test solve(ODEProblem(dyn,
ArrayPartition(ArrayPartition(zeros(1), [-1.0]),
ArrayPartition(zeros(1), [0.75])),
(0.0, 1.0)), Rodas5()).retcode == :Success
(0.0, 1.0)), Rodas5()).retcode == ReturnCode.Success
else
@test_broken solve(ODEProblem(dyn,
ArrayPartition(ArrayPartition(zeros(1), [-1.0]),
ArrayPartition(zeros(1), [0.75])),
(0.0, 1.0)), Rodas5()).retcode == :Success
(0.0, 1.0)), Rodas5()).retcode == ReturnCode.Success
end