Пример #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
Пример #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
Пример #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
Пример #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)
Пример #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
Пример #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)