import unittest
from util import eval_code

class test_opcodes_vars(unittest.TestCase):
    def test_variables(self):
        self.failUnless(eval_code("a=1","",title='test_opcodes_vars: 1'))
        self.failUnless(eval_code("global b;b=2", "",title='test_opcodes_vars: 2'))
        self.failUnless(eval_code("c=2;c+=1","",title='test_opcodes_vars: 3'))
        self.failUnless(eval_code("d=2;d=d+2","",title='test_opcodes_vars: 4'))

    def test_subscript(self):
        return
        self.failUnless(eval_code("a=[1,2,3];del a[1];a",""))
        
if __name__ == "__main__":
    unittest.main()

