Skip to content

Commit

Permalink
blacklit paradise
Browse files Browse the repository at this point in the history
  • Loading branch information
ambv committed May 22, 2024
1 parent a379bdc commit ac4a8a5
Showing 1 changed file with 63 additions and 62 deletions.
125 changes: 63 additions & 62 deletions Lib/test/test_pyrepl/test_pyrepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def prepare_reader(self, events):
def test_up_arrow_simple(self):
# fmt: off
code = (
'def f():\n'
' ...\n'
"def f():\n"
" ...\n"
)
# fmt: on
events = itertools.chain(
Expand All @@ -46,8 +46,8 @@ def test_up_arrow_simple(self):
def test_down_arrow_end_of_input(self):
# fmt: off
code = (
'def f():\n'
' ...\n'
"def f():\n"
" ...\n"
)
# fmt: on
events = itertools.chain(
Expand Down Expand Up @@ -315,14 +315,14 @@ def test_cursor_position_after_wrap_and_move_up(self):
def test_auto_indent_default(self):
# fmt: off
input_code = (
'def f():\n'
'pass\n\n'
"def f():\n"
"pass\n\n"
)

output_code = (
'def f():\n'
' pass\n'
' '
"def f():\n"
" pass\n"
" "
)
# fmt: on

Expand All @@ -342,10 +342,10 @@ def test_auto_indent_continuation(self):
)

output_code = (
'def f():\n'
' pass\n'
' pass\n'
' '
"def f():\n"
" pass\n"
" pass\n"
" "
)
# fmt: on

Expand All @@ -367,16 +367,16 @@ def test_auto_indent_prev_block(self):
"pass\n\n"
),
code_to_events(
'def g():\n'
'pass\n\n'
"def g():\n"
"pass\n\n"
),
)


output_code = (
'def g():\n'
' pass\n'
' '
"def g():\n"
" pass\n"
" "
)
# fmt: on

Expand Down Expand Up @@ -568,6 +568,7 @@ class Dummy:
@property
def test_func(self):
import warnings

warnings.warn("warnings\n")
return None

Expand All @@ -591,12 +592,12 @@ def prepare_reader(self, events):
def test_paste(self):
# fmt: off
code = (
'def a():\n'
' for x in range(10):\n'
' if x%2:\n'
' print(x)\n'
' else:\n'
' pass\n'
"def a():\n"
" for x in range(10):\n"
" if x%2:\n"
" print(x)\n"
" else:\n"
" pass\n"
)
# fmt: on

Expand All @@ -617,10 +618,10 @@ def test_paste(self):
def test_paste_mid_newlines(self):
# fmt: off
code = (
'def f():\n'
' x = y\n'
' \n'
' y = z\n'
"def f():\n"
" x = y\n"
" \n"
" y = z\n"
)
# fmt: on

Expand All @@ -641,16 +642,16 @@ def test_paste_mid_newlines(self):
def test_paste_mid_newlines_not_in_paste_mode(self):
# fmt: off
code = (
'def f():\n'
'x = y\n'
'\n'
'y = z\n\n'
"def f():\n"
"x = y\n"
"\n"
"y = z\n\n"
)

expected = (
'def f():\n'
' x = y\n'
' '
"def f():\n"
" x = y\n"
" "
)
# fmt: on

Expand All @@ -662,20 +663,20 @@ def test_paste_mid_newlines_not_in_paste_mode(self):
def test_paste_not_in_paste_mode(self):
# fmt: off
input_code = (
'def a():\n'
'for x in range(10):\n'
'if x%2:\n'
'print(x)\n'
'else:\n'
'pass\n\n'
"def a():\n"
"for x in range(10):\n"
"if x%2:\n"
"print(x)\n"
"else:\n"
"pass\n\n"
)

output_code = (
'def a():\n'
' for x in range(10):\n'
' if x%2:\n'
' print(x)\n'
' else:'
"def a():\n"
" for x in range(10):\n"
" if x%2:\n"
" print(x)\n"
" else:"
)
# fmt: on

Expand All @@ -688,25 +689,25 @@ def test_bracketed_paste(self):
"""Test that bracketed paste using \x1b[200~ and \x1b[201~ works."""
# fmt: off
input_code = (
'def a():\n'
' for x in range(10):\n'
'\n'
' if x%2:\n'
' print(x)\n'
'\n'
' else:\n'
' pass\n'
"def a():\n"
" for x in range(10):\n"
"\n"
" if x%2:\n"
" print(x)\n"
"\n"
" else:\n"
" pass\n"
)

output_code = (
'def a():\n'
' for x in range(10):\n'
'\n'
' if x%2:\n'
' print(x)\n'
'\n'
' else:\n'
' pass\n'
"def a():\n"
" for x in range(10):\n"
"\n"
" if x%2:\n"
" print(x)\n"
"\n"
" else:\n"
" pass\n"
)
# fmt: on

Expand Down

0 comments on commit ac4a8a5

Please sign in to comment.