Upgrading to GitLab 11.10.0. Expect errors and see debian-infrastructure-announce@lists.debian.org for further information.

Commit 31a6c0a5 authored by Mathieu Bridon's avatar Mathieu Bridon

tests: Check the behaviour detailed in issue #22

https://github.com/bochecha/ibus-cangjie/issues/22
parent 423f06a2
......@@ -187,3 +187,17 @@ class CangjieTestCase(unittest.TestCase):
self.assertEqual(len(self.engine._mock_auxiliary_text), 0)
self.assertEqual(len(self.engine._mock_committed_text), 0)
self.assertEqual(self.engine.lookuptable.get_number_of_candidates(), 0)
def test_autoclear_on_error(self):
# First make an error on purpose
self.engine.do_process_key_event(IBus.z, 0, 0)
self.engine.do_process_key_event(IBus.z, 0, 0)
self.engine.do_process_key_event(IBus.space, 0, 0)
self.assertEqual(len(self.engine._mock_auxiliary_text), 2)
self.assertEqual(len(self.engine.canberra._mock_played_events), 1)
# Now go on inputting
self.engine.do_process_key_event(IBus.z, 0, 0)
self.assertEqual(len(self.engine._mock_auxiliary_text), 1)
self.assertEqual(len(self.engine._mock_committed_text), 0)
self.assertEqual(self.engine.lookuptable.get_number_of_candidates(), 0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment