def case_02(self): return ( UpdateExpression("i = 10", self.C.ctx()), self.C.ctx().to_MutableContext(), 10, None, )
def expr(cls): return [UpdateExpression(s, cls.ctx()) for s in cls.exprstr()]
def case_updates_multi(self): ctx = self.C.ctx() e1 = UpdateExpression("i += 15", ctx) e2 = ClockResetExpression("c = 0", ctx) return "assignment", "i += 15", (0, 1), ctx, [e1, e2]
def case_updates_not_none(self): ctx = self.C.ctx() e = UpdateExpression("i += 15", ctx) return "assignment", "i += 15", (0, 1), ctx, [e]
def test_join_str(self, strings, res): r = UpdateExpression.join_strings(strings) assert r == res
def test_split(self, string, res): r = UpdateExpression.split_into_simple(string) for i, subexprstr in enumerate(r): assert "," not in subexprstr if res is not None: assert subexprstr == res[i]
def test_to_str(self, string, ctx): r = UpdateExpression(string, ctx) assert string == r.to_string()
def test_init(self, string, ctx): UpdateExpression(string, ctx)