コード例 #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)