Skip to content

Commit

Permalink
Add tests for in for StateStacks
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenJ committed Jul 5, 2024
1 parent bca7e74 commit b207190
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test_state_stack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@
@test size(stack) == 0
end

@testset "membership" begin
sm = HerbConstraints.StateManager()
stack = HerbConstraints.StateStack{Int}(sm)
push!(stack, 10)
push!(stack, 20)
push!(stack, 30)
@test in(stack, 10)
@test in(stack, 20)
@test in(stack, 30)
@test !in(stack, 40)

sm = HerbConstraints.StateManager()
stack = HerbConstraints.StateStack{String}(sm)
push!(stack, "A")
push!(stack, "B")
push!(stack, "C")
@test in(stack, "A")
@test in(stack, "B")
@test in(stack, "C")
@test !in(stack, "D")
end

@testset "from vector" begin
sm = HerbConstraints.StateManager()
stack = HerbConstraints.StateStack{Int}(sm, [10, 20, 30])
Expand Down

0 comments on commit b207190

Please sign in to comment.