Skip to content

Commit 205d76a

Browse files
test: fix tests
1 parent c1e1523 commit 205d76a

4 files changed

+6
-5
lines changed

test/initializationsystem.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ sol = solve(initprob)
2828

2929
initprob = ModelingToolkit.InitializationProblem(pend, 0.0, [x => 1, y => 0], [g => 1];
3030
guesses = ModelingToolkit.missing_variable_defaults(pend))
31-
@test initprob isa NonlinearProblem
31+
@test initprob isa NonlinearLeastSquaresProblem
3232
sol = solve(initprob)
3333
@test SciMLBase.successful_retcode(sol)
3434
@test sol.u == [0.0, 0.0, 0.0, 0.0]

test/mtkparameters.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ end
299299

300300
# Parameter timeseries
301301
ps = MTKParameters(([1.0, 1.0],), (BlockedArray(zeros(4), [2, 2]),),
302-
(), ())
302+
(), (), ())
303303
ps2 = SciMLStructures.replace(Discrete(), ps, ones(4))
304304
@test typeof(ps2.discrete) == typeof(ps.discrete)
305305
with_updated_parameter_timeseries_values(
@@ -316,7 +316,7 @@ with_updated_parameter_timeseries_values(
316316
ps = MTKParameters(
317317
(), (BlockedArray([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], [3, 3]),
318318
BlockedArray(falses(1), [1, 0])),
319-
(), ())
319+
(), (), ())
320320
@test SciMLBase.get_saveable_values(sys, ps, 1).x isa Tuple{Vector{Float64}, Vector{Bool}}
321321
tsidx1 = 1
322322
tsidx2 = 2

test/scc_nonlinear_problem.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ using NonlinearSolve, SCCNonlinearSolve
33
using OrdinaryDiffEq
44
using SciMLBase, Symbolics
55
using LinearAlgebra, Test
6+
using ModelingToolkit: t_nounits as t, D_nounits as D
67

78
@testset "Trivial case" begin
89
function f!(du, u, p)
@@ -30,7 +31,7 @@ using LinearAlgebra, Test
3031
sol2 = solve(sccprob, NewtonRaphson())
3132
@test SciMLBase.successful_retcode(sol1)
3233
@test SciMLBase.successful_retcode(sol2)
33-
@test sol1.u sol2.u
34+
@test sol1[u] sol2[u]
3435
end
3536

3637
@testset "With parameters" begin

test/split_parameters.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ S = get_sensitivity(closed_loop, :u)
206206
BlockedArray([[1 2; 3 4], [2 4; 6 8]], [1, 1])),
207207
# (BlockedArray([[true, false], [false, true]]), BlockedArray([[[1 2; 3 4]], [[2 4; 6 8]]])),
208208
([5, 6],),
209-
(["hi", "bye"], [:lie, :die]))
209+
(["hi", "bye"], [:lie, :die]), ())
210210
@test ps[ParameterIndex(Tunable(), 1)] == 1.0
211211
@test ps[ParameterIndex(Tunable(), 2:4)] == collect(2.0:4.0)
212212
@test ps[ParameterIndex(Tunable(), reshape(4:7, 2, 2))] == reshape(4.0:7.0, 2, 2)

0 commit comments

Comments
 (0)