Skip to content

Commit fb8d58b

Browse files
committed
handle error-message matching missing in julia v1.6
1 parent a5597f3 commit fb8d58b

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

test/linearize.jl

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,28 @@ lsys = ModelingToolkit.reorder_states(lsys, states(ssys), reverse(desired_order)
105105
@test lsys.D == [4400 -4400]
106106

107107
## Test that there is a warning when input is misspecified
108-
@test_throws "Some specified inputs were not found" linearize(pid,
109-
[
110-
pid.reference.u,
111-
pid.measurement.u,
112-
], [ctr_output.u])
113-
@test_throws "Some specified outputs were not found" linearize(pid,
114-
[reference.u, measurement.u],
115-
[pid.ctr_output.u])
108+
if VERSION >= v"1.7"
109+
@test_throws "Some specified inputs were not found" linearize(pid,
110+
[
111+
pid.reference.u,
112+
pid.measurement.u,
113+
], [ctr_output.u])
114+
@test_throws "Some specified outputs were not found" linearize(pid,
115+
[
116+
reference.u,
117+
measurement.u,
118+
],
119+
[pid.ctr_output.u])
120+
else # v1.6 does not have the feature to match error message
121+
@test_throws ErrorException linearize(pid,
122+
[
123+
pid.reference.u,
124+
pid.measurement.u,
125+
], [ctr_output.u])
126+
@test_throws ErrorException linearize(pid,
127+
[reference.u, measurement.u],
128+
[pid.ctr_output.u])
129+
end
116130

117131
## Test operating points
118132

0 commit comments

Comments
 (0)