Non-scrolling based selection tests all pass

This commit is contained in:
Kovid Goyal
2020-02-25 08:11:46 +05:30
parent e03aabd972
commit 5bbc15583e
4 changed files with 50 additions and 35 deletions

View File

@@ -85,6 +85,8 @@ class TestMouse(BaseTest):
self.ae(sel(), '1234')
release(x=3.6)
self.ae(sel(), '1234')
press(x=4), release(x=0.6)
self.ae(sel(), '234')
# Single cell select
init()
@@ -110,11 +112,11 @@ class TestMouse(BaseTest):
s.draw(' f gh')
s.draw(' stuv')
s.draw('X Y')
multi_click(x=1.6)
multi_click(x=1.4)
self.ae(sel(), 'ab')
move(3.6)
self.ae(sel(), 'ab cd')
release(3, 1)
release(3.6, 1)
self.ae(sel(), 'ab cd f gh')
multi_click(x=1, y=2)
self.ae(sel(), 'stuvX')
@@ -152,14 +154,21 @@ class TestMouse(BaseTest):
# Rectangle select
init()
press(x=1, y=1, modifiers=GLFW_MOD_ALT | GLFW_MOD_CONTROL)
move(x=3, y=3)
move(x=3.6, y=3)
self.ae(sel(), '789bcdghi')
release()
release(x=3, y=3)
self.ae(sel(), '78bcgh')
press(x=3.6, y=1, modifiers=GLFW_MOD_ALT | GLFW_MOD_CONTROL)
self.ae(sel(), '')
move(x=1, y=3)
self.ae(sel(), '789bcdghi')
release(x=1.6)
self.ae(sel(), '3489')
# scrolling
init()
press(x=1)
scroll(x=1)
scroll(x=1.6)
self.ae(sel(), 'LMNO12')
scroll(x=1)
self.ae(sel(), 'GHIJKLMNO12')