mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 06:56:13 +02:00
[ruby/reline] Fix default and additional key bindings vanish bug
(https://github.com/ruby/reline/pull/697)
fc9b4d2274
This commit is contained in:
parent
2eefbef2ee
commit
c78cebb469
5 changed files with 13 additions and 17 deletions
|
@ -417,6 +417,18 @@ class Reline::Config::Test < Reline::TestCase
|
|||
assert_equal expected, @config.key_bindings
|
||||
end
|
||||
|
||||
def test_key_bindings_with_reset
|
||||
# @config.reset is called after each readline.
|
||||
# inputrc file is read once, so key binding shouldn't be cleared by @config.reset
|
||||
@config.add_default_key_binding('default'.bytes, 'DEFAULT'.bytes)
|
||||
@config.read_lines(<<~'LINES'.lines)
|
||||
"additional": "ADDITIONAL"
|
||||
LINES
|
||||
@config.reset
|
||||
expected = { 'default'.bytes => 'DEFAULT'.bytes, 'additional'.bytes => 'ADDITIONAL'.bytes }
|
||||
assert_equal expected, @config.key_bindings
|
||||
end
|
||||
|
||||
def test_history_size
|
||||
@config.read_lines(<<~LINES.lines)
|
||||
set history-size 5000
|
||||
|
|
|
@ -23,7 +23,6 @@ class Reline::WithinPipeTest < Reline::TestCase
|
|||
@reader.close
|
||||
@output_writer.close
|
||||
@config.reset
|
||||
@config.reset_default_key_bindings
|
||||
Reline.test_reset
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue