From f997170c3eb0afa64d10b39b86799bad67dc5c02 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 3 Jun 2021 20:24:44 +1000 Subject: Add APIs for setting appearance (traditional blob or plain text) and colour of representations and support setting a representation for the "\r\n" line end sequence. --- test/simpleTests.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test') diff --git a/test/simpleTests.py b/test/simpleTests.py index 3f607bed6..63a752da4 100644 --- a/test/simpleTests.py +++ b/test/simpleTests.py @@ -1309,6 +1309,31 @@ class TestRepresentations(unittest.TestCase): result = self.ed.GetRepresentation(ohmSign) self.assertEquals(result, ohmExplained) + def testNul(self): + self.ed.SetRepresentation(b"", b"Nul") + result = self.ed.GetRepresentation(b"") + self.assertEquals(result, b"Nul") + + def testAppearance(self): + ohmSign = b"\xe2\x84\xa6" + ohmExplained = b"U+2126 \xe2\x84\xa6" + self.ed.SetRepresentation(ohmSign, ohmExplained) + result = self.ed.GetRepresentationAppearance(ohmSign) + self.assertEquals(result, self.ed.SC_REPRESENTATION_BLOB) + self.ed.SetRepresentationAppearance(ohmSign, self.ed.SC_REPRESENTATION_PLAIN) + result = self.ed.GetRepresentationAppearance(ohmSign) + self.assertEquals(result, self.ed.SC_REPRESENTATION_PLAIN) + + def testColour(self): + ohmSign = b"\xe2\x84\xa6" + ohmExplained = b"U+2126 \xe2\x84\xa6" + self.ed.SetRepresentation(ohmSign, ohmExplained) + result = self.ed.GetRepresentationColour(ohmSign) + self.assertEquals(result, 0) + self.ed.SetRepresentationColour(ohmSign, 0x10203040) + result = self.ed.GetRepresentationColour(ohmSign) + self.assertEquals(result, 0x10203040) + @unittest.skipUnless(lexersAvailable, "no lexers included") class TestProperties(unittest.TestCase): -- cgit v1.2.3