Skip to content

Commit

Permalink
Adds test.
Browse files Browse the repository at this point in the history
  • Loading branch information
dalthviz committed Aug 18, 2017
1 parent a128f12 commit 4dbf48f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spyder/widgets/tests/test_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,28 @@ def editor_cells_bot(base_editor_bot):

# Tests
#-------------------------------

def test_find_number_matches(qtbot):
"""Test for number matches in find/replace."""
editor_stack, editor = setup_editor(qtbot)
editor_stack.find_widget.case_button.setChecked(True)
text = ' test \nTEST \nTest \ntesT '
editor.set_text(text)

editor_stack.find_widget.search_text.add_text('test')
editor_stack.find_widget.find(changed=False, forward=True,
rehighlight=False,
multiline_replace_check=False)
editor_text = editor_stack.find_widget.number_matches_text.text()
assert editor_text == '1 of 1'

editor_stack.find_widget.search_text.add_text('fail')
editor_stack.find_widget.find(changed=False, forward=True,
rehighlight=False,
multiline_replace_check=False)
editor_text = editor_stack.find_widget.number_matches_text.text()
assert editor_text == 'no matches'

def test_move_current_line_up(editor_bot):
editor_stack, editor, qtbot = editor_bot

Expand Down

0 comments on commit 4dbf48f

Please sign in to comment.