summaryrefslogtreecommitdiff
path: root/tests/unit/browser/test_caret.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-05-22 19:12:49 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-05-22 20:48:06 +0200
commit0f839b848b9e7738d14bce3311e3cacf8e02019f (patch)
treea023eedd9a21f6cb6c37dad8d23dbb232c347606 /tests/unit/browser/test_caret.py
parent781a68a10e10f559575f23c6ed8faa2fb46ab7d9 (diff)
downloadqutebrowser-0f839b848b9e7738d14bce3311e3cacf8e02019f.tar.gz
qutebrowser-0f839b848b9e7738d14bce3311e3cacf8e02019f.zip
caret: Style improvements for line mode
Diffstat (limited to 'tests/unit/browser/test_caret.py')
-rw-r--r--tests/unit/browser/test_caret.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/unit/browser/test_caret.py b/tests/unit/browser/test_caret.py
index 13994a654..2b65081f0 100644
--- a/tests/unit/browser/test_caret.py
+++ b/tests/unit/browser/test_caret.py
@@ -73,7 +73,7 @@ class Selection:
def check_multiline(self, expected, *, strip=False):
self.check(textwrap.dedent(expected).strip(), strip=strip)
- def toggle(self, line=False):
+ def toggle(self, *, line=False):
with self._qtbot.wait_signal(self._caret.selection_toggled):
self._caret.toggle_selection(line=line)
@@ -396,24 +396,24 @@ class TestReverse:
class TestLineSelection:
def test_toggle(self, caret, selection):
- selection.toggle(True)
+ selection.toggle(line=True)
selection.check("one two three")
def test_toggle_untoggle(self, caret, selection):
selection.toggle()
selection.check("")
- selection.toggle(True)
+ selection.toggle(line=True)
selection.check("one two three")
selection.toggle()
selection.check("one two three")
def test_from_center(self, caret, selection):
caret.move_to_next_char(4)
- selection.toggle(True)
+ selection.toggle(line=True)
selection.check("one two three")
def test_more_lines(self, caret, selection):
- selection.toggle(True)
+ selection.toggle(line=True)
caret.move_to_next_line(2)
selection.check_multiline("""
one two three
@@ -423,26 +423,26 @@ class TestLineSelection:
""", strip=True)
def test_not_selecting_char(self, caret, selection):
- selection.toggle(True)
+ selection.toggle(line=True)
caret.move_to_next_char()
selection.check("one two three")
caret.move_to_prev_char()
selection.check("one two three")
def test_selecting_prev_next_word(self, caret, selection):
- selection.toggle(True)
+ selection.toggle(line=True)
caret.move_to_next_word()
selection.check("one two three")
caret.move_to_prev_word()
selection.check("one two three")
def test_selecting_end_word(self, caret, selection):
- selection.toggle(True)
+ selection.toggle(line=True)
caret.move_to_end_of_word()
selection.check("one two three")
def test_selecting_prev_next_line(self, caret, selection):
- selection.toggle(True)
+ selection.toggle(line=True)
caret.move_to_next_line()
selection.check_multiline("""
one two three
@@ -452,14 +452,14 @@ class TestLineSelection:
selection.check("one two three")
def test_not_selecting_start_end_line(self, caret, selection):
- selection.toggle(True)
+ selection.toggle(line=True)
caret.move_to_end_of_line()
selection.check("one two three")
caret.move_to_start_of_line()
selection.check("one two three")
def test_selecting_block(self, caret, selection):
- selection.toggle(True)
+ selection.toggle(line=True)
caret.move_to_end_of_next_block()
selection.check_multiline("""
one two three
@@ -467,7 +467,7 @@ class TestLineSelection:
""", strip=True)
def test_selecting_start_end_document(self, caret, selection):
- selection.toggle(True)
+ selection.toggle(line=True)
caret.move_to_end_of_document()
selection.check_multiline("""
one two three
@@ -476,5 +476,6 @@ class TestLineSelection:
four five six
vier fünf sechs
""", strip=True)
+
caret.move_to_start_of_document()
selection.check("one two three")