mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
Fix missing asserts and add (disabled) tests for things that don't work yet.
This commit is contained in:
@@ -11,7 +11,28 @@ exec("assert 4 == x", {'x': 2}, {'x': 4})
|
||||
|
||||
exec("assert max(1, 2) == 2", {}, {})
|
||||
|
||||
exec("max(1, 5, square(5)) == 25", None)
|
||||
exec("assert max(1, 5, square(5)) == 25", None)
|
||||
|
||||
#
|
||||
# These doesn't work yet:
|
||||
#
|
||||
# Local environment shouldn't replace global environment:
|
||||
#
|
||||
# exec("assert max(1, 5, square(5)) == 25", None, {})
|
||||
#
|
||||
# Closures aren't available if local scope is replaced:
|
||||
#
|
||||
# def g():
|
||||
# seven = "seven"
|
||||
# def f():
|
||||
# try:
|
||||
# exec("seven", None, {})
|
||||
# except NameError:
|
||||
# pass
|
||||
# else:
|
||||
# raise NameError("seven shouldn't be in scope")
|
||||
# f()
|
||||
# g()
|
||||
|
||||
try:
|
||||
exec("", 1)
|
||||
|
||||
Reference in New Issue
Block a user