Skip to content

Commit c9c97f7

Browse files
committed
fix this test
1 parent 44549b9 commit c9c97f7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

Lib/test/test_pyrepl/test_fancycompleter.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,16 @@ def test_complete_global_colored(self):
106106
compl = Completer({'foobar': 1, 'foobazzz': 2}, ColorConfig)
107107
self.assertEqual(compl.global_matches('foo'), ['fooba'])
108108
matches = compl.global_matches('fooba')
109+
110+
# these are the fake escape sequences which are needed so that
111+
# readline displays the matches in the proper order
112+
N0 = f"\x1b[000;00m"
113+
N1 = f"\x1b[001;00m"
114+
109115
self.assertEqual(set(matches), {
110116
' ',
111-
'\x1b[001;00m\x1b[33;01mfoobazzz\x1b[00m',
112-
'\x1b[000;00m\x1b[33;01mfoobar\x1b[00m',
117+
f'{N0}{ANSIColors.BOLD_YELLOW}foobar{ANSIColors.RESET}',
118+
f'{N1}{ANSIColors.BOLD_YELLOW}foobazzz{ANSIColors.RESET}',
113119
})
114120
self.assertEqual(compl.global_matches('foobaz'), ['foobazzz'])
115121
self.assertEqual(compl.global_matches('nothing'), [])

0 commit comments

Comments
 (0)