From 199d7ee000fcb1ce24d3f4a919dc825e6c0d2f45 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 22 Jul 2013 19:36:55 +1000 Subject: Added the character representation feature. --- test/simpleTests.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/simpleTests.py') 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): -- cgit v1.2.3