[Python-checkins] python/dist/src/Lib/test test_builtin.py,1.9,1.10

jvr@users.sourceforge.net jvr@users.sourceforge.net
Sun, 09 Feb 2003 12:38:50 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv21078/Lib/test

Modified Files:
	test_builtin.py 
Log Message:
patch 680474 that fixes bug 679880: compile/eval/exec refused utf-8 bom
mark. Added unit test.


Index: test_builtin.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_builtin.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_builtin.py	4 Feb 2003 20:24:45 -0000	1.9
--- test_builtin.py	9 Feb 2003 20:38:47 -0000	1.10
***************
*** 191,194 ****
--- 191,196 ----
      def test_compile(self):
          compile('print 1\n', '', 'exec')
+         bom = '\xef\xbb\xbf'
+         compile(bom + 'print 1\n', '', 'exec')
          self.assertRaises(TypeError, compile)
          self.assertRaises(ValueError, compile, 'print 42\n', '<string>', 'badmode')
***************
*** 306,309 ****
--- 308,313 ----
              self.assertEqual(eval(unicode('b'), globals, locals), 200)
              self.assertEqual(eval(unicode('c'), globals, locals), 300)
+             bom = '\xef\xbb\xbf'
+             self.assertEqual(eval(bom + 'a', globals, locals), 1)
          self.assertRaises(TypeError, eval)
          self.assertRaises(TypeError, eval, ())