summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compiler.py
diff options
context:
space:
mode:
authorNeil Schemenauer <nascheme@enme.ucalgary.ca>2005-06-02 05:55:20 (GMT)
committerNeil Schemenauer <nascheme@enme.ucalgary.ca>2005-06-02 05:55:20 (GMT)
commitf36947032f4e99b2c55fc25fa36a1960c4423cbb (patch)
tree68a6122f3415232b331b59a408e469b7d728063a /Lib/test/test_compiler.py
parent76276177dea7d3e1412390e36a2c260f3f8107cb (diff)
downloadcpython-f36947032f4e99b2c55fc25fa36a1960c4423cbb.zip
cpython-f36947032f4e99b2c55fc25fa36a1960c4423cbb.tar.gz
cpython-f36947032f4e99b2c55fc25fa36a1960c4423cbb.tar.bz2
Fix compiler.ast.flatten function so that it works on lists.
Diffstat (limited to 'Lib/test/test_compiler.py')
-rw-r--r--Lib/test/test_compiler.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py
index 32302a1..6bfe225 100644
--- a/Lib/test/test_compiler.py
+++ b/Lib/test/test_compiler.py
@@ -1,4 +1,5 @@
import compiler
+from compiler.ast import flatten
import os
import test.test_support
import unittest
@@ -60,6 +61,10 @@ class CompilerTest(unittest.TestCase):
for child in node.getChildNodes():
self.check_lineno(child)
+ def testFlatten(self):
+ self.assertEquals(flatten([1, [2]]), [1, 2])
+ self.assertEquals(flatten((1, (2,))), [1, 2])
+
NOLINENO = (compiler.ast.Module, compiler.ast.Stmt, compiler.ast.Discard)
###############################################################################