aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-06-11 16:22:59 +1000
committerNeil <nyamatongwe@gmail.com>2020-06-11 16:22:59 +1000
commit5ebd653f630d2f37c696f7f6928de4fa133b8486 (patch)
treec847e71248933e357745ccae011b859d2b7c3dd1 /test
parent87342a6cec6c3239e9891481f7774ffeef4fa71f (diff)
downloadscintilla-mirror-5ebd653f630d2f37c696f7f6928de4fa133b8486.tar.gz
Backport: Fix bug on Win32 where calling WM_GETTEXT for more text than in document could
return less text than in document. Backport of changeset 8302:2faf8ba9d1fb.
Diffstat (limited to 'test')
-rw-r--r--test/win32Tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/win32Tests.py b/test/win32Tests.py
index 21a89dbed..6a1d27387 100644
--- a/test/win32Tests.py
+++ b/test/win32Tests.py
@@ -129,6 +129,19 @@ class TestWins(unittest.TestCase):
self.assertEquals(lenData, 2)
self.assertEquals(data.value, "ab")
+ def testGetTextLongNonASCII(self):
+ # With 1 multibyte character in document ask for 4 and ensure 1 character
+ # returned correctly.
+ self.ed.SetCodePage(65001)
+ t = "å"
+ tu8 = t.encode("UTF-8")
+ self.SetText(tu8)
+ data = ctypes.create_unicode_buffer(100)
+ lenData = self.GetText(4, data)
+ self.assertEquals(self.ed.GetStatus(), 0)
+ self.assertEquals(lenData, 1)
+ self.assertEquals(data.value, t)
+
def testGetTextShort(self):
self.assertEquals(self.ed.GetStatus(), 0)
self.SetText(b"ab")