diff options
author | nyamatongwe <unknown> | 2011-07-25 14:15:06 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2011-07-25 14:15:06 +1000 |
commit | b8500b3f2677edb364815a81b262055e526dce93 (patch) | |
tree | 1ef1ca803c251b1d347d89d8c0455c3aea454efa /test/simpleTests.py | |
parent | 09fd0473a17f58b3f744d99a3f57cca60bf2aaf1 (diff) | |
download | scintilla-mirror-b8500b3f2677edb364815a81b262055e526dce93.tar.gz |
Using 'from __future__ import unicode_literals' to make work on Python 2.7.
Diffstat (limited to 'test/simpleTests.py')
-rw-r--r-- | test/simpleTests.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/simpleTests.py b/test/simpleTests.py index e7e4b3671..a6345d3f4 100644 --- a/test/simpleTests.py +++ b/test/simpleTests.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- from __future__ import with_statement +from __future__ import unicode_literals -import ctypes, os, unittest +import ctypes, os, sys, unittest import XiteWin @@ -361,12 +362,15 @@ class TestSimple(unittest.TestCase): def testLinePositions(self): text = b"ab\ncd\nef" + nl = b"\n" + if sys.version_info[0] == 3: + nl = ord(b"\n") self.ed.AddText(len(text), text) self.assertEquals(self.ed.LineFromPosition(-1), 0) line = 0 for pos in range(len(text)+1): self.assertEquals(self.ed.LineFromPosition(pos), line) - if pos < len(text) and text[pos] == ord("\n"): + if pos < len(text) and text[pos] == nl: line += 1 def testWordPositions(self): |