import unittest
from util import eval_code

class test_opcodes_inplace(unittest.TestCase):
        
    def test_inplace_math_opcodes(self):
        self.failUnless(eval_code("d=1;d+=1;d","2\n",title='test_opcodes_inplace: 1'))
        self.failUnless(eval_code("d=1;d*=6;d","6\n",title='test_opcodes_inplace: 2'))
        self.failUnless(eval_code("d=10;d/=5;d","2\n",title='test_opcodes_inplace: 3'))
        self.failUnless(eval_code("d=100;d-=50;d","50\n",title='test_opcodes_inplace: 4'))
        self.failUnless(eval_code("a=2;a**=2;a","4\n",title='test_opcodes_inplace: 5'))

if __name__ == "__main__":
    unittest.main()

