From 37346fdfcef8b7873130d6c159be567d93273d6d Mon Sep 17 00:00:00 2001 From: schillic Date: Sat, 2 Mar 2024 15:25:18 +0100 Subject: [PATCH] define helper functions in tests only once --- test/continuous.jl | 3 --- test/discrete.jl | 3 --- test/helper_functions.jl | 3 +++ test/runtests.jl | 1 + 4 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 test/helper_functions.jl diff --git a/test/continuous.jl b/test/continuous.jl index 5bb0e58f..cb6fa398 100644 --- a/test/continuous.jl +++ b/test/continuous.jl @@ -19,9 +19,6 @@ p = 2x^2 - 3x + y sdp = 2 # blackbox system -add_one(x) = x .+ 1 -add_one(x, u) = x .+ 1 .+ u -add_one(x, u, w) = x .+ 1 .+ u .+ w state = [1.0; 2.0] input = 1 noise = [3.0; 1.0] diff --git a/test/discrete.jl b/test/discrete.jl index ddbc0f3c..9bbc5dc8 100644 --- a/test/discrete.jl +++ b/test/discrete.jl @@ -17,9 +17,6 @@ p = 2x^2 - 3x + y sdp = 2 # blackbox system -add_one(x) = x .+ 1 -add_one(x, u) = x .+ 1 .+ u -add_one(x, u, w) = x .+ 1 .+ u .+ w state = [1.0; 2.0] input = 1 noise = [3.0; 1.0] diff --git a/test/helper_functions.jl b/test/helper_functions.jl new file mode 100644 index 00000000..b7751611 --- /dev/null +++ b/test/helper_functions.jl @@ -0,0 +1,3 @@ +add_one(x) = x .+ 1 +add_one(x, u) = x .+ 1 .+ u +add_one(x, u, w) = x .+ 1 .+ u .+ w diff --git a/test/runtests.jl b/test/runtests.jl index 163eae82..aaf03aba 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -17,6 +17,7 @@ end @testset "Abstract systems" begin include("abstract.jl") end +include("helper_functions.jl") @testset "Continuous systems" begin include("continuous.jl") end