aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/win32Tests.py
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
commit48f0363fe07d2d56b1e4d597abcd7db26e15dd80 (patch)
tree83a61e292013a8b723073f85882d94543f885dd5 /test/win32Tests.py
parent7a1d35a4877726511f73fc2dc2b3f301224a4cfb (diff)
downloadscintilla-mirror-48f0363fe07d2d56b1e4d597abcd7db26e15dd80.tar.gz
Fix bug on Win32 where calling WM_GETTEXT for more text than in document could
return less text than in document.
Diffstat (limited to 'test/win32Tests.py')
-rw-r--r--test/win32Tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/win32Tests.py b/test/win32Tests.py
index 6032e8955..d47ed66db 100644
--- a/test/win32Tests.py
+++ b/test/win32Tests.py
@@ -130,6 +130,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")