diff options
| author | Neil <nyamatongwe@gmail.com> | 2021-05-11 08:36:14 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2021-05-11 08:36:14 +1000 | 
| commit | a2eaf21d3ce1010aa32bb09b409fc6b019b31732 (patch) | |
| tree | c09b0b996948d4eb88bd459bd4917dea4f7ab9eb /test/simpleTests.py | |
| parent | 7b98798ee4047aec150927d3b5fc6a75f78e0273 (diff) | |
| download | scintilla-mirror-a2eaf21d3ce1010aa32bb09b409fc6b019b31732.tar.gz | |
Add tests for element APIs. Fix SCI_GETELEMENTCOLOUR to return value including
alpha. Set selection and caret elements as allowing translucency.
Diffstat (limited to 'test/simpleTests.py')
| -rw-r--r-- | test/simpleTests.py | 33 | 
1 files changed, 33 insertions, 0 deletions
| diff --git a/test/simpleTests.py b/test/simpleTests.py index 63efc8019..d6c00170c 100644 --- a/test/simpleTests.py +++ b/test/simpleTests.py @@ -1923,6 +1923,39 @@ class TestStyleAttributes(unittest.TestCase):  		self.ed.FontLocale = testLocale  		self.assertEquals(self.ed.GetFontLocale(), testLocale) +class TestElements(unittest.TestCase): +	""" These tests are just to ensure that the calls set and retrieve values. +	They do not check the visual appearance of the style attributes. +	""" +	def setUp(self): +		self.xite = Xite.xiteFrame +		self.ed = self.xite.ed +		self.ed.ClearAll() +		self.ed.EmptyUndoBuffer() +		self.testColourAlpha = 0x18171615 + +	def tearDown(self): +		pass + +	def testIsSet(self): +		self.assertEquals(self.ed.GetElementIsSet(self.ed.SC_ELEMENT_LIST), 0) + +	def testAllowsTranslucent(self): +		self.assertEquals(self.ed.GetElementAllowsTranslucent(self.ed.SC_ELEMENT_LIST), 0) +		self.assertEquals(self.ed.GetElementAllowsTranslucent(self.ed.SC_ELEMENT_SELECTION_TEXT), 1) + +	def testChanging(self): +		self.ed.SetElementColour(self.ed.SC_ELEMENT_LIST_BACK, self.testColourAlpha) +		self.assertEquals(self.ed.GetElementColour(self.ed.SC_ELEMENT_LIST_BACK), self.testColourAlpha) +		self.assertEquals(self.ed.GetElementIsSet(self.ed.SC_ELEMENT_LIST_BACK), 1) + +	def testReset(self): +		self.ed.SetElementColour(self.ed.SC_ELEMENT_LIST_BACK, self.testColourAlpha) +		self.assertEquals(self.ed.GetElementColour(self.ed.SC_ELEMENT_LIST_BACK), self.testColourAlpha) +		self.ed.ResetElementColour(self.ed.SC_ELEMENT_LIST_BACK) +		self.assertEquals(self.ed.GetElementColour(self.ed.SC_ELEMENT_LIST_BACK), 0) +		self.assertEquals(self.ed.GetElementIsSet(self.ed.SC_ELEMENT_LIST_BACK), 0) +  class TestIndices(unittest.TestCase):  	def setUp(self):  		self.xite = Xite.xiteFrame | 
