Skip to content

Commit c8d1759

Browse files
committed
Address review: remove issue URL from docstring, add newline test
Per @picnixz's review: - Remove issue URL from bow_ws() docstring (keep reference in tests only) - Add period to issue reference comment in test - Add test_bow_ws_with_newlines to cover newline as whitespace boundary
1 parent 140faf1 commit c8d1759

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Lib/_pyrepl/reader.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ def bow_ws(self, p: int | None = None) -> int:
423423
424424
p defaults to self.pos; only whitespace is considered a word
425425
boundary, matching the behavior of unix-word-rubout in bash/readline.
426-
See https://github.com/python/cpython/issues/146044
427426
"""
428427
if p is None:
429428
p = self.pos

Lib/test/test_pyrepl/test_reader.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def test_setpos_from_xy_for_non_printing_char(self):
359359
self.assertEqual(reader.pos, 7)
360360

361361
def test_bow_ws_stops_at_whitespace(self):
362-
# See https://github.com/python/cpython/issues/146044
362+
# See https://github.com/python/cpython/issues/146044.
363363
reader = prepare_reader(prepare_console([]))
364364
reader.buffer = list("foo.bar baz")
365365
reader.pos = len(reader.buffer)
@@ -386,6 +386,12 @@ def test_bow_ws_with_tabs(self):
386386
reader.pos = len(reader.buffer)
387387
self.assertEqual(reader.bow_ws(), 4)
388388

389+
def test_bow_ws_with_newlines(self):
390+
reader = prepare_reader(prepare_console([]))
391+
reader.buffer = list("foo\nbar")
392+
reader.pos = len(reader.buffer)
393+
self.assertEqual(reader.bow_ws(), 4)
394+
389395
@force_colorized_test_class
390396
class TestReaderInColor(ScreenEqualMixin, TestCase):
391397
def test_syntax_highlighting_basic(self):

0 commit comments

Comments
 (0)