Skip to content

Commit

Permalink
Add tests for helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
eliascarv committed May 17, 2022
1 parent ad2d9e7 commit afe865a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ using TruthTables: TruthTable
@test Tables.getcolumn(tt, Symbol("¬y")) == Bool[0, 1, 0, 1]
@test Tables.getcolumn(tt, Symbol("¬x ∧ ¬y")) == Bool[0, 0, 0, 1]
@test Tables.getcolumn(tt, Symbol("¬(x ∨ y) <--> ¬x ∧ ¬y")) == Bool[1, 1, 1, 1]

# helper functions
expr = :(p && q --> r)
@test TruthTables.propnames(expr) == [:p, :q, :r]
@test TruthTables.getsubexprs(expr) == [:(p && q), :(p && q --> r)]
@test TruthTables.exprname(expr) == Symbol("p ∧ q --> r")

@test_throws ArgumentError TruthTables._propname(1)
@test_throws ArgumentError TruthTables._kwarg(:(full => true))
end

@testset "TruthTable show" begin
Expand Down

0 comments on commit afe865a

Please sign in to comment.