aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2019-05-02 14:14:08 +1000
committerNeil <nyamatongwe@gmail.com>2019-05-02 14:14:08 +1000
commit9e002fa3716e99b6170a9c6339194c7a6dcb4f87 (patch)
tree96b41f9c67063f11826f624b43280c81a5ce3b1e /test
parentf84f2a3daef704cb309009f51b5da9f325979f68 (diff)
downloadscintilla-mirror-9e002fa3716e99b6170a9c6339194c7a6dcb4f87.tar.gz
Backport: Optimize SCI_GETTEXT by calling Document::GetCharRange instead of looping for
each byte. Backport of changeset 7489:c9118d39963d.
Diffstat (limited to 'test')
-rw-r--r--test/simpleTests.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/simpleTests.py b/test/simpleTests.py
index 9a170a2f9..e4512b617 100644
--- a/test/simpleTests.py
+++ b/test/simpleTests.py
@@ -540,9 +540,14 @@ class TestSimple(unittest.TestCase):
def testGetSet(self):
self.ed.SetContents(b"abc")
self.assertEquals(self.ed.TextLength, 3)
- result = ctypes.create_string_buffer(b"\0" * 5)
+ # String buffer containing exactly 5 digits
+ result = ctypes.create_string_buffer(b"12345", 5)
+ self.assertEquals(result.raw, b"12345")
length = self.ed.GetText(4, result)
+ self.assertEquals(length, 3)
self.assertEquals(result.value, b"abc")
+ # GetText has written the 3 bytes of text and a terminating NUL but left the final digit 5
+ self.assertEquals(result.raw, b"abc\x005")
def testAppend(self):
self.ed.SetContents(b"abc")