diff --git a/test/test_rulenode_operators.jl b/test/test_rulenode_operators.jl index dee0c14..fd52ea6 100644 --- a/test/test_rulenode_operators.jl +++ b/test/test_rulenode_operators.jl @@ -15,4 +15,27 @@ end @test !isvariable(g₁, RuleNode(7, g₁), SomeDefinitions) @test isvariable(g₁, RuleNode(7, g₁)) end + + @testset "Create `RuleNode`s with `Hole`s for children" begin + g = @csgrammar begin + A = 1 | 2 | 3 + B = A + A + end + + r = rulenode_with_empty_children(4, g) + + @test get_children(r)[1].domain == [1, 1, 1, 0] + @test get_children(r)[2].domain == [1, 1, 1, 0] + end + + @testset "Create `UniformHole`s with `Hole`s for children" begin + g = @csgrammar begin + A = 1 | 2 | 3 + B = (A + A) | (A - A) + end + h = uniform_hole_with_empty_children(BitVector([0, 0, 0, 1, 1]), g) + + @test get_children(h)[1].domain == [1, 1, 1, 0, 0] + @test get_children(h)[2].domain == [1, 1, 1, 0, 0] + end end