comparison tests/test_pymonkey.py @ 138:1a982ee56458

A script's bytecode is now exposed as a buffer object.
author Atul Varma <varmaa@toolness.com>
date Sun, 23 Aug 2009 22:26:58 -0700
parents f83a1603c417
children ce8099238c01
comparison
equal deleted inserted replaced
137:f83a1603c417 138:1a982ee56458
45 self.assertRaises(pymonkey.error, run, '5f') 45 self.assertRaises(pymonkey.error, run, '5f')
46 self.assertEqual( 46 self.assertEqual(
47 self.last_exception.args[1], 47 self.last_exception.args[1],
48 u'SyntaxError: missing ; before statement' 48 u'SyntaxError: missing ; before statement'
49 ) 49 )
50
51 def testScriptIsExposedAsBuffer(self):
52 rt = pymonkey.Runtime()
53 cx = rt.new_context()
54 obj = cx.new_object()
55 script = cx.compile_script(obj, 'foo', '<string>', 1)
56 self.assertTrue(len(buffer(script)) > 0)
50 57
51 def testCompileScriptWorks(self): 58 def testCompileScriptWorks(self):
52 self.assertEqual(self._execjs('5 + 1'), 6) 59 self.assertEqual(self._execjs('5 + 1'), 6)
53 60
54 def testErrorsRaisedIncludeStrings(self): 61 def testErrorsRaisedIncludeStrings(self):