Mercurial > pymonkey
comparison tests/test_pymonkey.py @ 143:df97699fc104
Added base_lineno and line_extent members to the script object.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Mon, 24 Aug 2009 22:40:53 -0700 |
parents | a2c1db5ece2b |
children | 5d53f6293a81 |
comparison
equal
deleted
inserted
replaced
142:a2c1db5ece2b | 143:df97699fc104 |
---|---|
50 | 50 |
51 def testScriptHasFilenameMember(self): | 51 def testScriptHasFilenameMember(self): |
52 cx = pymonkey.Runtime().new_context() | 52 cx = pymonkey.Runtime().new_context() |
53 script = cx.compile_script('foo', '<string>', 1) | 53 script = cx.compile_script('foo', '<string>', 1) |
54 self.assertEqual(script.filename, '<string>') | 54 self.assertEqual(script.filename, '<string>') |
55 | |
56 def testScriptHasLineInfo(self): | |
57 cx = pymonkey.Runtime().new_context() | |
58 script = cx.compile_script('foo\nbar', '<string>', 1) | |
59 self.assertEqual(script.base_lineno, 1) | |
60 self.assertEqual(script.line_extent, 2) | |
55 | 61 |
56 def testScriptIsExposedAsBuffer(self): | 62 def testScriptIsExposedAsBuffer(self): |
57 rt = pymonkey.Runtime() | 63 rt = pymonkey.Runtime() |
58 cx = rt.new_context() | 64 cx = rt.new_context() |
59 script = cx.compile_script('foo', '<string>', 1) | 65 script = cx.compile_script('foo', '<string>', 1) |