From c8b8650e823e9ea0fb59bdd9108c9c491a4ff4ea Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 4 Sep 2015 11:06:59 +1000 Subject: Bug [#1757]. Treat CRLF as two characters in SCI_COUNTCHARACTERS. --- test/simpleTests.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/simpleTests.py') diff --git a/test/simpleTests.py b/test/simpleTests.py index 9b7525066..c7240b269 100644 --- a/test/simpleTests.py +++ b/test/simpleTests.py @@ -1577,6 +1577,7 @@ class TestCharacterNavigation(unittest.TestCase): tv = t.encode("UTF-8") self.ed.SetContents(tv) self.assertEquals(self.ed.PositionRelative(1, 2), 6) + self.assertEquals(self.ed.CountCharacters(1, 6), 2) self.assertEquals(self.ed.PositionRelative(6, -2), 1) pos = 0 previous = 0 @@ -1593,6 +1594,13 @@ class TestCharacterNavigation(unittest.TestCase): self.assert_(after < previous) previous = after + def testLineEnd(self): + t = "a\r\nb\nc" + tv = t.encode("UTF-8") + self.ed.SetContents(tv) + for i in range(0, len(t)): + self.assertEquals(self.ed.CountCharacters(0, i), i) + class TestCaseMapping(unittest.TestCase): def setUp(self): self.xite = Xite.xiteFrame -- cgit v1.2.3