mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #23441: rcompleter now prints a tab character instead of displaying
possible completions for an empty word. Initial patch by Martin Sekera.
This commit is contained in:
parent
0bd5fb0112
commit
aaf6114b37
3 changed files with 17 additions and 4 deletions
|
@ -1,4 +1,3 @@
|
|||
from test import support
|
||||
import unittest
|
||||
import builtins
|
||||
import rlcompleter
|
||||
|
@ -65,9 +64,14 @@ class TestRlcompleter(unittest.TestCase):
|
|||
['egg.{}('.format(x) for x in dir(str)
|
||||
if x.startswith('s')])
|
||||
|
||||
def test_main():
|
||||
support.run_unittest(TestRlcompleter)
|
||||
def test_complete(self):
|
||||
completer = rlcompleter.Completer()
|
||||
self.assertEqual(completer.complete('', 0), '\t')
|
||||
self.assertEqual(completer.complete('a', 0), 'and')
|
||||
self.assertEqual(completer.complete('a', 1), 'as')
|
||||
self.assertEqual(completer.complete('as', 2), 'assert')
|
||||
self.assertEqual(completer.complete('an', 0), 'and')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_main()
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue