File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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' ), [])
You can’t perform that action at this time.
0 commit comments