# Copyright 2006-2007 Grant T. Olson.
# See LICENSE for terms.
import unittest
from util import eval_code

class test_opcodes_print(unittest.TestCase):
    def test_print_opcodes(self):
        self.failUnless(eval_code("print","\n"))
        self.failUnless(eval_code("print 'a','b','c'","a b c\n")) # THis really is bad for now
        self.failUnless(eval_code("a,b=1,2;print a,b","1 2\n"))
        self.failUnless(eval_code("import sys;print >> sys.stderr, 1,2",""))
        self.failUnless(eval_code("import sys;print >> sys.stdout, 'i am so great'","i am so great\n"))
        self.failUnless(eval_code("""

print 'i Rule'
print 1,2,3

print 3

print 1,2



""","i Rule\n1 2 3\n3\n1 2\n",'exec'))

if __name__ == "__main__":
    unittest.main()

