Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
30bb06be
Commit
30bb06be
authored
Feb 23, 2015
by
Travis Hance
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uncommented more eval tests
parent
1f55b52d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
14 deletions
+24
-14
test/tests/eval_test.py
test/tests/eval_test.py
+24
-14
No files found.
test/tests/eval_test.py
View file @
30bb06be
# lots of eval functionality not implemented
#
TODO
lots of eval functionality not implemented
print
eval
(
"3 + 4"
)
...
...
@@ -48,13 +48,13 @@ def func():
eval
(
"[h for h in range(5)]"
)
print
h
#
h2 = 2
#
print eval("h2 + sum([h2 for h2 in range(5)])")
#
print 'h2', h2
h2
=
2
print
eval
(
"h2 + sum([h2 for h2 in range(5)])"
)
print
'h2'
,
h2
#
h3 = 2
#
print eval("sum([h3 for h3 in range(5)]) + h3")
#
print 'h3', h3
h3
=
2
print
eval
(
"sum([h3 for h3 in range(5)]) + h3"
)
print
'h3'
,
h3
eval
(
"[i for i in range(5)]"
)
...
...
@@ -86,7 +86,6 @@ print 'eval eval o', eval("eval('o')")
#print eval("[(lambda p : p + o)(5) for o in range(5)]")
"""
shadow1
=
1000
shadow2
=
1000
shadow3
=
1000
...
...
@@ -100,22 +99,35 @@ def func2():
print
'shadow3'
,
eval
(
"shadow3 + sum([2 for shadow3 in range(5)]) + shadow3"
)
func2
()
print 'shadow1', shadow2
print 'shadow2', shadow2
print 'shadow3', shadow3
#print 'shadow1', shadow2
#print 'shadow2', shadow2
#print 'shadow3', shadow3
def
func3
():
loc
=
1234
print eval("(lambda arg : arg + loc)(12)")
try
:
print
eval
(
"(lambda arg : arg + loc)(12)"
)
except
NameError
as
e
:
print
'NameError'
,
e
.
message
try
:
print
eval
(
"loc + (lambda arg : arg + loc)(12)"
)
except
NameError
as
e
:
print
'NameError'
,
e
.
message
func3
()
"""
changing_global = -1
def print_changing_global():
print 'changing_global is', changing_global
return 0
eval("[print_changing_global() for changing_global in range(5)]")
"""
def
do_changing_local
():
# this won't get modified:
changing_local
=
-
1
def
print_changing_local
():
print
'changing_local is'
,
changing_local
...
...
@@ -123,8 +135,6 @@ def do_changing_local():
eval
(
"[print_changing_local() for changing_local in range(5)]"
)
do_changing_local
()
"""
x
=
2
def
wrap
():
x
=
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment