From 3a93cab40f0005b6eb1090e07f68bff268caf6cd Mon Sep 17 00:00:00 2001 From: mitchphillipson Date: Wed, 27 Sep 2023 10:08:57 -0500 Subject: [PATCH] Add test deactivating elements --- test/activate.jl | 33 +++++++++++++++++++++++++++++++++ test/runtests.jl | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 test/activate.jl diff --git a/test/activate.jl b/test/activate.jl new file mode 100644 index 0000000..d360514 --- /dev/null +++ b/test/activate.jl @@ -0,0 +1,33 @@ +@testset "Loading and unloading a model" begin + GU = GamsUniverse() + + @create_set!(GU,:i,"Test Set",begin + a,"elm" + b,"elm2" + end) + + alias(GU,:i,:j) + + + + @create_parameters(GU,begin + :p, (:i,:j), "test parm" + end) + + deactivate(GU,:i,:a) + + + @create_parameters(GU,begin + :q, (:i,:j), "test parm" + end) + + @test GU[:p][:i,:j] == [0 0] + @test GU[:q][:i,:j] == [0 0] + + activate(GU,:i,:a) + + + @test GU[:p][:i,:j] == [0 0; 0 0] + @test GU[:q][:i,:j] == [0 0; 0 0] + +end \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index bc6e86e..3abacbf 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,7 +6,7 @@ using GamsStructure include("load_unload.jl") - + include("activate.jl") end \ No newline at end of file