Skip to content

Commit 3e36c47

Browse files
test: make input output tests less sensitive to FP error
1 parent f7466d0 commit 3e36c47

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/input_output_handling.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ end
173173
p = [rand()]
174174
x = [rand()]
175175
u = [rand()]
176-
@test f[1](x, u, p, 1) == -x + u
176+
@test f[1](x, u, p, 1) -x + u
177177

178178
# With disturbance inputs
179179
@variables x(t)=0 u(t)=0 [input = true] d(t)=0
@@ -191,7 +191,7 @@ end
191191
p = [rand()]
192192
x = [rand()]
193193
u = [rand()]
194-
@test f[1](x, u, p, 1) == -x + u
194+
@test f[1](x, u, p, 1) -x + u
195195

196196
## With added d argument
197197
@variables x(t)=0 u(t)=0 [input = true] d(t)=0
@@ -210,7 +210,7 @@ end
210210
x = [rand()]
211211
u = [rand()]
212212
d = [rand()]
213-
@test f[1](x, u, p, t, d) == -x + u + [d[]^2]
213+
@test f[1](x, u, p, t, d) -x + u + [d[]^2]
214214
end
215215
end
216216

@@ -434,7 +434,7 @@ matrices, ssys = linearize(augmented_sys,
434434
(; io_sys,) = ModelingToolkit.generate_control_function(sys, simplify = true)
435435
obsfn = ModelingToolkit.build_explicit_observed_function(
436436
io_sys, [x + u * t]; inputs = [u])
437-
@test obsfn([1.0], [2.0], MTKParameters(io_sys, []), 3.0) == [7.0]
437+
@test obsfn([1.0], [2.0], MTKParameters(io_sys, []), 3.0) [7.0]
438438
end
439439

440440
# https://github.com/SciML/ModelingToolkit.jl/issues/2896
@@ -445,7 +445,7 @@ end
445445
@named sys = ODESystem(eqs, t, [x], [])
446446

447447
f, dvs, ps, io_sys = ModelingToolkit.generate_control_function(sys, simplify = true)
448-
@test f[1]([0.5], nothing, MTKParameters(io_sys, []), 0.0) == [1.0]
448+
@test f[1]([0.5], nothing, MTKParameters(io_sys, []), 0.0) [1.0]
449449
end
450450

451451
@testset "With callable symbolic" begin

0 commit comments

Comments
 (0)