+++ /dev/null
-import unittest\r
-from test import test_support\r
-\r
-# Silence Py3k warning\r
-test_support.import_module('compiler', deprecated=True)\r
-from compiler import transformer, ast\r
-from compiler import compile\r
-\r
-class Tests(unittest.TestCase):\r
-\r
- def testMultipleLHS(self):\r
- """ Test multiple targets on the left hand side. """\r
-\r
- snippets = ['a, b = 1, 2',\r
- '(a, b) = 1, 2',\r
- '((a, b), c) = (1, 2), 3']\r
-\r
- for s in snippets:\r
- a = transformer.parse(s)\r
- self.assertIsInstance(a, ast.Module)\r
- child1 = a.getChildNodes()[0]\r
- self.assertIsInstance(child1, ast.Stmt)\r
- child2 = child1.getChildNodes()[0]\r
- self.assertIsInstance(child2, ast.Assign)\r
-\r
- # This actually tests the compiler, but it's a way to assure the ast\r
- # is correct\r
- c = compile(s, '<string>', 'single')\r
- vals = {}\r
- exec c in vals\r
- assert vals['a'] == 1\r
- assert vals['b'] == 2\r
-\r
-def test_main():\r
- test_support.run_unittest(Tests)\r
-\r
-if __name__ == "__main__":\r
- test_main()\r