import unittest
from util import eval_code

pystone_bug = """

Array1Glob = [0]*51
Array2Glob = map(lambda x: x[:], [Array1Glob]*51)


"""
pystone_bug_repro = """
a=[0]*51

"""

pystone_bug_3 = """
Array1Glob = [0]*51
Array2Glob = map(lambda x: x[:], [Array1Glob]*51)
Array2Glob[8][7] = 10

"""

class test_opcodes_tuples(unittest.TestCase):

    #def test_pystone_bug(self):
    #    self.failUnless(eval_code(pystone_bug_repro,"",title='test_opcodes_bugs: 1'))
    #    self.failUnless(eval_code(pystone_bug,"",title='test_opcodes_bugs: 1'))
    #    self.failUnless(eval_code(pystone_bug_3,"",title='test_opcodes_bugs: 1'))

    def test_list_multiply_bug(self):
        self.failUnless(eval_code("[0]*2",'4',title='test_slice_bug:1'))

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