Commit 22d2b261 authored by Shane Hathaway's avatar Shane Hathaway

Added a test that segfaulted with the incorrect stack handling in redirected

print statements, but now passes.
parent 9b8e292e
...@@ -8,6 +8,10 @@ def print1(): ...@@ -8,6 +8,10 @@ def print1():
print 'world!', print 'world!',
return printed return printed
def printStuff():
print 'a', 'b', 'c',
return printed
def printToNone(): def printToNone():
x = None x = None
print >>x, 'Hello, world!', print >>x, 'Hello, world!',
......
...@@ -182,6 +182,10 @@ class RestrictionTests(unittest.TestCase): ...@@ -182,6 +182,10 @@ class RestrictionTests(unittest.TestCase):
else: else:
assert 0, res assert 0, res
def checkPrintStuff(self):
res = self.execFunc('printStuff')
assert res == 'a b c', res
def checkPrintLines(self): def checkPrintLines(self):
res = self.execFunc('printLines') res = self.execFunc('printLines')
assert res == '0 1 2\n3 4 5\n6 7 8\n', res assert res == '0 1 2\n3 4 5\n6 7 8\n', res
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment