diff options
author | nyamatongwe <devnull@localhost> | 2011-07-25 14:15:06 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2011-07-25 14:15:06 +1000 |
commit | bbab85d57513310b019006b999fd04b88a34ec49 (patch) | |
tree | d20a31cb37c0b69e7d4dd5271bb6bc73d58dcabb | |
parent | a57bbf73951d047ec5b96d5c81381b8b6c52abb3 (diff) | |
download | scintilla-mirror-bbab85d57513310b019006b999fd04b88a34ec49.tar.gz |
Using 'from __future__ import unicode_literals' to make work on Python 2.7.
-rw-r--r-- | test/XiteMenu.py | 2 | ||||
-rw-r--r-- | test/XiteWin.py | 1 | ||||
-rw-r--r-- | test/performanceTests.py | 1 | ||||
-rw-r--r-- | test/simpleTests.py | 8 |
4 files changed, 10 insertions, 2 deletions
diff --git a/test/XiteMenu.py b/test/XiteMenu.py index f265387cb..b047cf804 100644 --- a/test/XiteMenu.py +++ b/test/XiteMenu.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from __future__ import unicode_literals + """ Define the menu structure used by the Pentacle applications """ MenuStructure = [ diff --git a/test/XiteWin.py b/test/XiteWin.py index 6cb4f35f6..695fb0e0a 100644 --- a/test/XiteWin.py +++ b/test/XiteWin.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import with_statement +from __future__ import unicode_literals import os, sys, unittest diff --git a/test/performanceTests.py b/test/performanceTests.py index 9dd1a9c17..da9c87759 100644 --- a/test/performanceTests.py +++ b/test/performanceTests.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import with_statement +from __future__ import unicode_literals import os, string, time, unittest 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): |