diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-11-17 22:06:11 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-11-17 22:06:11 +0000 |
commit | 7dac1fc2bb08661e5f7cdfe41a75fffccf136265 (patch) | |
tree | 18e1348bfbf91afbb3fc080509bacedb59d4faad /test/ast.py | |
parent | 02eac60bd2ddc420650d1a66217e89347a834497 (diff) | |
download | external_python_mako-7dac1fc2bb08661e5f7cdfe41a75fffccf136265.tar.gz external_python_mako-7dac1fc2bb08661e5f7cdfe41a75fffccf136265.tar.bz2 external_python_mako-7dac1fc2bb08661e5f7cdfe41a75fffccf136265.zip |
lexer completed
Diffstat (limited to 'test/ast.py')
-rw-r--r-- | test/ast.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ast.py b/test/ast.py index 501fc4a..588697e 100644 --- a/test/ast.py +++ b/test/ast.py @@ -31,6 +31,17 @@ print "Another expr", c assert parsed.undeclared_identifiers == util.Set(['x', 'y', 'z']) assert parsed.declared_identifiers == util.Set() + def test_locate_identifiers_2(self): + code = """ +result = [] +data = get_data() +for x in data: + result.append(x+7) +""" + parsed = ast.PythonCode(code) + assert parsed.undeclared_identifiers == util.Set(['get_data']) + assert parsed.declared_identifiers == util.Set(['result', 'data', 'x']) + def test_function_decl(self): """test getting the arguments from a function""" code = "def foo(a, b, c=None, d='hi', e=x, f=y+7):pass" |