зеркало из https://github.com/github/ruby.git
Skip indented comment lines [Bug #15981]
This commit is contained in:
Родитель
0c3e6e86bd
Коммит
ee861e43f7
|
@ -119,7 +119,7 @@ class Reline::Config
|
|||
@if_stack = []
|
||||
|
||||
lines.each_with_index do |line, no|
|
||||
next if line.start_with?('#')
|
||||
next if line.match(/\A\s*#/)
|
||||
|
||||
no += 1
|
||||
|
||||
|
|
|
@ -28,6 +28,11 @@ class Reline::Config::Test < Reline::TestCase
|
|||
assert_equal :audible, @config.instance_variable_get(:@bell_style)
|
||||
end
|
||||
|
||||
def test_comment_line
|
||||
@config.read_lines([" #a: error\n"])
|
||||
assert_not_include @config.key_bindings, nil
|
||||
end
|
||||
|
||||
def test_bind_key
|
||||
assert_equal ['input'.bytes, 'abcde'.bytes], @config.bind_key('"input"', '"abcde"')
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче