diff options
author | Neil <nyamatongwe@gmail.com> | 2025-03-27 19:37:53 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2025-03-27 19:37:53 +1100 |
commit | b451f612b65dfe1ad678080e7b897733be310d01 (patch) | |
tree | 113777e775fb812602ed46479eea9c028570ab77 /test | |
parent | ceaa07a1bc4d05a89218d09bd5c5c3ce411845d5 (diff) | |
download | scintilla-mirror-b451f612b65dfe1ad678080e7b897733be310d01.tar.gz |
Add performance test for case-insensitive DBCS searching.
Diffstat (limited to 'test')
-rw-r--r-- | test/performanceTests.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/performanceTests.py b/test/performanceTests.py index 2da14db03..8cf9c11b3 100644 --- a/test/performanceTests.py +++ b/test/performanceTests.py @@ -145,5 +145,27 @@ class TestPerformance(unittest.TestCase): print("%6.3f testUTF8AsciiSearches" % duration) self.xite.DoEvents() + def testShiftJISSearches(self): + self.ed.SetCodePage(932) + self.ed.StyleSetCharacterSet(32, 128) + oneLine = "Fold Margin=折りたたみ表示用の余白(&F)\n".encode('cp932') + manyLines = oneLine * 100000 + manyLines = manyLines + "φ\n".encode('cp932') + #~ with open("932.txt", "wb") as fp: + #~ fp.write(manyLines) + self.ed.AddText(len(manyLines), manyLines) + searchString = "φ".encode('cp932') + start = timer() + for i in range(20): + self.ed.TargetStart = 0 + self.ed.TargetEnd = self.ed.Length-1 + self.ed.SearchFlags = 0 + pos = self.ed.SearchInTarget(len(searchString), searchString) + self.assertTrue(pos > 0) + end = timer() + duration = end - start + print("%6.3f testShiftJISSearches" % duration) + self.xite.DoEvents() + if __name__ == '__main__': Xite.main("performanceTests") |