Skip to content

Commit

Permalink
Add test deactivating elements
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchphillipson committed Sep 27, 2023
1 parent 500244c commit 3a93cab
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions test/activate.jl
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using GamsStructure

include("load_unload.jl")


include("activate.jl")


end

0 comments on commit 3a93cab

Please sign in to comment.