Ejemplo n.º 1
0
    def test_get_conjuncts_and_op(self):
        a, b = Signal("a"), Signal("b")
        conjunction_expr = BinOp("*", a, b)
        conjuncts = _get_conjuncts(conjunction_expr)

        assert len(conjuncts) == 2
        assert a in conjuncts
        assert b in conjuncts
Ejemplo n.º 2
0
    def test_get_conjuncts_and_op(self):
        a, b = Signal('a'), Signal('b')
        conjunction_expr = BinOp('*', a, b)
        conjuncts = _get_conjuncts(conjunction_expr)

        assert len(conjuncts) == 2
        assert a in conjuncts
        assert b in conjuncts
Ejemplo n.º 3
0
    def test_get_conjuncts_recursion(self):
        a, b, c = Signal("a"), Signal("b"), Signal("c")
        conjunction_expr = BinOp("*", a, BinOp("*", b, c))
        conjuncts = _get_conjuncts(conjunction_expr)

        assert len(conjuncts) == 3
Ejemplo n.º 4
0
    def test_get_conjuncts_no_conjuncts(self):
        a, b = Signal("a"), Signal("b")
        conjunction_expr = BinOp("+", a, b)
        conjuncts = _get_conjuncts(conjunction_expr)

        assert conjuncts == [conjunction_expr], str(conjunction_expr)
Ejemplo n.º 5
0
    def test_get_conjuncts_recursion(self):
        a, b, c = Signal('a'), Signal('b'), Signal('c')
        conjunction_expr = BinOp('*', a, BinOp('*', b, c))
        conjuncts = _get_conjuncts(conjunction_expr)

        assert len(conjuncts) == 3
Ejemplo n.º 6
0
    def test_get_conjuncts_no_conjuncts(self):
        a, b = Signal('a'), Signal('b')
        conjunction_expr = BinOp('+', a, b)
        conjuncts = _get_conjuncts(conjunction_expr)

        assert conjuncts == [conjunction_expr], str(conjunction_expr)