aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/simpleTests.py
diff options
context:
space:
mode:
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):