| 207 | self.assertIn(b"History length: 0", output) |
| 208 | |
| 209 | def test_set_complete_delims(self): |
| 210 | script = textwrap.dedent(""" |
| 211 | import readline |
| 212 | def complete(text, state): |
| 213 | if state == 0 and text == "$": |
| 214 | return "$complete" |
| 215 | return None |
| 216 | if readline.backend == "editline": |
| 217 | readline.parse_and_bind(r'bind "\\t" rl_complete') |
| 218 | else: |
| 219 | readline.parse_and_bind(r'"\\t": complete') |
| 220 | readline.set_completer_delims(" \\t\\n") |
| 221 | readline.set_completer(complete) |
| 222 | print(input()) |
| 223 | """) |
| 224 | |
| 225 | output = run_pty(script, input=b"$\t\n") |
| 226 | self.assertIn(b"$complete", output) |
| 227 | |
| 228 | def test_nonascii(self): |
| 229 | loc = locale.setlocale(locale.LC_CTYPE, None) |