Skip to content

Commit 5290aaf

Browse files
committed
Add local test catching ^J
1 parent cdb2a63 commit 5290aaf

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lib/test/test_pdb.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4996,6 +4996,16 @@ def test_code_display(self):
49964996
p.set_trace(commands=['ll', 'c'])
49974997
self.assertNotIn("\x1b", output.getvalue())
49984998

4999+
def test_list_does_not_colorize_trailing_newlines(self):
5000+
# Keep the marker split so it is not present in the listed source.
5001+
caret_newline = "^" + "J"
5002+
output = io.StringIO()
5003+
p = pdb.Pdb(stdout=output, colorize=True)
5004+
p.set_trace(commands=['list', 'continue'])
5005+
result = output.getvalue()
5006+
self.assertIn("\x1b", result)
5007+
self.assertNotIn(caret_newline, result)
5008+
49995009
def test_stack_entry(self):
50005010
output = io.StringIO()
50015011
p = pdb.Pdb(stdout=output, colorize=True)

0 commit comments

Comments
 (0)