class Test var _x as int get x from var def inc ensure .x == old .x + 1 body _x += 1 def badInc ensure .x == old .x body _x += 1 def main is shared t = Test() t.inc t.inc expect EnsureException t.badInc