Mercurial > pymonkey
diff tests/test_pymonkey.py @ 146:b1cf9decc36f
Added 'lineno' and 'pc' attributes to stack frame information.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sat, 29 Aug 2009 13:16:43 -0700 |
parents | 5d53f6293a81 |
children | ebc0ff767290 |
line wrap: on
line diff
--- a/tests/test_pymonkey.py Fri Aug 28 22:46:07 2009 -0700 +++ b/tests/test_pymonkey.py Sat Aug 29 13:16:43 2009 -0700 @@ -60,8 +60,11 @@ jsfunc = cx.new_function(func, func.__name__) cx.define_property(obj, func.__name__, jsfunc) cx.evaluate_script(obj, 'func()', '<string>', 1) - self.assertEqual(stack_holder[0]['caller']['script'].filename, - '<string>') + script = stack_holder[0]['caller']['script'] + pc = stack_holder[0]['caller']['pc'] + self.assertEqual(script.filename, '<string>') + self.assertEqual(stack_holder[0]['caller']['lineno'], 1) + self.assertTrue(pc >= 0 and pc < len(buffer(script))) def testScriptHasFilenameMember(self): cx = pymonkey.Runtime().new_context()