summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_rlcompleter.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-07-27 21:08:24 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-07-27 21:08:24 (GMT)
commit0659c43d73e5d9ce4540c53f76b66ddb904be6de (patch)
tree1bff65dba973b12c1d6cfd77f8661f4f2cba5cb3 /Lib/test/test_rlcompleter.py
parent367c07f89fa3caf728ab704ea88b701b2bd5992c (diff)
parentaaf6114b37df5b86d605e396ac0547e5cac492ae (diff)
downloadcpython-0659c43d73e5d9ce4540c53f76b66ddb904be6de.zip
cpython-0659c43d73e5d9ce4540c53f76b66ddb904be6de.tar.gz
cpython-0659c43d73e5d9ce4540c53f76b66ddb904be6de.tar.bz2
Issue #23441: rcompleter now prints a tab character instead of displaying
possible completions for an empty word. Initial patch by Martin Sekera.
Diffstat (limited to 'Lib/test/test_rlcompleter.py')
-rw-r--r--Lib/test/test_rlcompleter.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_rlcompleter.py b/Lib/test/test_rlcompleter.py
index 9d4d0bd..d37b620 100644
--- a/Lib/test/test_rlcompleter.py
+++ b/Lib/test/test_rlcompleter.py
@@ -64,5 +64,13 @@ class TestRlcompleter(unittest.TestCase):
['egg.{}('.format(x) for x in dir(str)
if x.startswith('s')])
+ 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__':
unittest.main()