aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/simpleTests.py
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2013-07-22 19:36:55 +1000
committerNeil <nyamatongwe@gmail.com>2013-07-22 19:36:55 +1000
commit5cbf336f95db427027a72699be6f5034762515aa (patch)
treefb8e4f0eccb49363752995c85b5b9217f340282b /test/simpleTests.py
parent79bd92adfc0ee27029fed81efd03fb5784c60f73 (diff)
downloadscintilla-mirror-5cbf336f95db427027a72699be6f5034762515aa.tar.gz
Added the character representation feature.
Diffstat (limited to 'test/simpleTests.py')
-rw-r--r--test/simpleTests.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/simpleTests.py b/test/simpleTests.py
index 4ce6e39ea..57607c375 100644
--- a/test/simpleTests.py
+++ b/test/simpleTests.py
@@ -1104,6 +1104,32 @@ class TestSearch(unittest.TestCase):
self.assertEquals(-1, self.ed.FindBytes(0, self.ed.Length, b"\\xAB", flags))
self.assertEquals(0, self.ed.FindBytes(0, self.ed.Length, b"\\xAD", flags))
+class TestRepresentations(unittest.TestCase):
+
+ def setUp(self):
+ self.xite = Xite.xiteFrame
+ self.ed = self.xite.ed
+ self.ed.ClearAll()
+ self.ed.EmptyUndoBuffer()
+
+ def testGetControl(self):
+ result = self.ed.GetRepresentation(b"\001")
+ self.assertEquals(result, b"SOH")
+
+ def testClearControl(self):
+ result = self.ed.GetRepresentation(b"\002")
+ self.assertEquals(result, b"STX")
+ self.ed.ClearRepresentation(b"\002")
+ result = self.ed.GetRepresentation(b"\002")
+ self.assertEquals(result, b"")
+
+ def testSetOhm(self):
+ ohmSign = b"\xe2\x84\xa6"
+ ohmExplained = b"U+2126 \xe2\x84\xa6"
+ self.ed.SetRepresentation(ohmSign, ohmExplained)
+ result = self.ed.GetRepresentation(ohmSign)
+ self.assertEquals(result, ohmExplained)
+
class TestProperties(unittest.TestCase):
def setUp(self):