Skip to content

Commit

Permalink
add tests for 'split_candidates'
Browse files Browse the repository at this point in the history
  • Loading branch information
liuanji committed Nov 14, 2020
1 parent 5b36299 commit 109c3ef
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/transformations_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,24 @@ end
end


@testset "Split candidate test" begin
a = compile(PlainLogicCircuit, Lit(1))
b = compile(PlainLogicCircuit, Lit(2))
c = compile(PlainLogicCircuit, Lit(3))
d = compile(PlainLogicCircuit, Lit(4))
e = compile(PlainLogicCircuit, -Lit(4))

f = disjoin(conjoin(a, b), conjoin(c, d))
candidates, variable_scope = split_candidates(f)
@test length(candidates) == 0

g = disjoin(conjoin(disjoin(conjoin(d, b), conjoin(e, b)), a))
candidates, variable_scope = split_candidates(g)
@test length(candidates) == 1
@test candidates[1][1] == g
end


@testset "Circuit standardize test" begin
a = compile(PlainLogicCircuit, Lit(1))
b = compile(PlainLogicCircuit, Lit(2))
Expand Down

0 comments on commit 109c3ef

Please sign in to comment.