aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/simpleTests.py
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-07-25 14:15:06 +1000
committernyamatongwe <devnull@localhost>2011-07-25 14:15:06 +1000
commitbbab85d57513310b019006b999fd04b88a34ec49 (patch)
treed20a31cb37c0b69e7d4dd5271bb6bc73d58dcabb /test/simpleTests.py
parenta57bbf73951d047ec5b96d5c81381b8b6c52abb3 (diff)
downloadscintilla-mirror-bbab85d57513310b019006b999fd04b88a34ec49.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.py8
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):