def make_iff(test, clause, clauses, els_clause): els_clause = preparse(els_clause) if not isinstance(els_clause, Var) else None test = preparse(test[0]) clause = preparse(clause) clauses1 = [(preparse(t), preparse(c)) for t, c in clauses] return special.iff([(test, clause)] + clauses1, els_clause)
def testiff2(self): eq_(eval(iff(((0, prin(1)), (0,prin(2))), prin(3))), None)
def test_iff2(self): eq_(preparse(iff(1).do[2].elsif(3).do[4].els[5]), special.iff([(1, 2), (3, 4)], 5))
def test_iff1(self): assert_raises(DinpySyntaxError, preparse, iff(v.i == 1)[2]) eq_(preparse(iff(v.i == 1).do[2]), special.iff([(arith.eq(i, 1), 2)]))
def test_iff2(self): eq_(preparse(iff(1) .do[2] .elsif(3) .do[4]. els [5]), special.iff([(1, 2),(3, 4)], 5))
def test_iff1(self): assert_raises(DinpySyntaxError, preparse, iff(v.i==1)[2]) eq_(preparse(iff(v.i==1).do[2]), special.iff([(arith.eq(i,1), 2)]))
def make_iff(test, clause, clauses, els_clause): els_clause = preparse(els_clause) if not isinstance(els_clause, Var) else None test = preparse(test[0]) clause = preparse(clause) clauses1 = [(preparse(t), preparse(c)) for t, c in clauses] return special.iff([(test, clause)]+clauses1, els_clause)