Skip to content

Commit

Permalink
Update commenting/uncommenting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
remisalmon committed Nov 29, 2023
1 parent f573a5e commit 4ae32bf
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions spyder/plugins/editor/widgets/codeeditor/tests/test_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,30 +62,30 @@ def test_single_line_comment(codeeditor):
# Toggle comment with space at the right of prefix but manually inserted
text = toggle_comment(editor, start_line=2)
assert text == ("class a():\n"
" self.b = 1\n"
" self.b = 1\n"
" # print(self.b)\n"
"# \n"
)
# Toggle comment with space insertion
text = toggle_comment(editor, start_line=2)
assert text == ("class a():\n"
" # self.b = 1\n"
" # self.b = 1\n"
" # print(self.b)\n"
"# \n"
)
# Toggle comment deleting inserted space
text = toggle_comment(editor, start_line=2)
assert text == ("class a():\n"
" self.b = 1\n"
" self.b = 1\n"
" # print(self.b)\n"
"# \n"
)
# Toggle comment with space at the right and left of prefix
# but manually inserted
text = toggle_comment(editor, start_line=3)
assert text == ("class a():\n"
" self.b = 1\n"
" print(self.b)\n"
" self.b = 1\n"
" print(self.b)\n"
"# \n"
)

Expand All @@ -102,23 +102,23 @@ def test_selection_comment(codeeditor):
# Toggle manually commented code
text = toggle_comment(editor, single_line=False)
assert text == ("class a():\n"
" self.b = 1\n"
" print(self.b)\n"
" \n"
" self.b = 1\n"
" print(self.b)\n"
" \n"
)
# Toggle comment inserting prefix and space
text = toggle_comment(editor, single_line=False)
assert text == ("# class a():\n"
"# self.b = 1\n"
"# print(self.b)\n"
" \n"
"# self.b = 1\n"
"# print(self.b)\n"
" \n"
)
# Toggle comment deleting inserted prefix and space
text = toggle_comment(editor, single_line=False)
assert text == ("class a():\n"
" self.b = 1\n"
" print(self.b)\n"
" \n"
" self.b = 1\n"
" print(self.b)\n"
" \n"
)
# Test compatibility with Spyder 3 commenting structure
text = ("#class a():\n"
Expand All @@ -130,9 +130,9 @@ def test_selection_comment(codeeditor):
# Toggle comment deleting inserted prefix (without space)
text = toggle_comment(editor, single_line=False)
assert text == ("class a():\n"
" self.b = 1\n"
" print(self.b)\n"
" \n"
" self.b = 1\n"
" print(self.b)\n"
" \n"
)


Expand Down

0 comments on commit 4ae32bf

Please sign in to comment.