import unittest
from util import eval_code

class test_opcodes_build(unittest.TestCase):
    def test_build(self):
        self.failUnless(eval_code("{'a':12345,'b':23456}['b']","23456\n",title="test_opcodes_build: 1"))
        self.failUnless(eval_code("a,b,c=1,2,3;(a,b,c)","(1, 2, 3)\n",title="test_opcodes_build: 2"))
        self.failUnless(eval_code("a=[1,2,3];a","[1, 2, 3]\n",title="test_opcodes_build: 3"))
        self.failUnless(eval_code("{'a':1L,'b':2L}['b']","2L\n",title="test_opcodes_build: 4"))
        #self.failUnless(eval_code("{'a':1L,'b':2}['b']","2\n",title="test_opcodes_build: 5"))
        self.failUnless(eval_code("{'a':1,'b':2L}['b']","2L\n",title="test_opcodes_build: 6"))
        self.failUnless(eval_code("{'a':1,'b':2}['b']","2\n",title="test_opcodes_build: 7"))
   

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

