summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-07-04 19:29:07 +0900
committeraycabta <aycabta@gmail.com>2019-07-04 19:29:07 +0900
commit6fa7ed453e81ef3e74b2699db0533eb79e815dbb (patch)
tree8c6e2c0a023549512af3af637db3713e03245c8f /test
parent265b9a0edf48e96d053724c9676af953e920246c (diff)
Check commented out line in inputrc correctly
Diffstat (limited to 'test')
-rw-r--r--test/reline/test_config.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/reline/test_config.rb b/test/reline/test_config.rb
index 58f265d817..193b74ec03 100644
--- a/test/reline/test_config.rb
+++ b/test/reline/test_config.rb
@@ -163,4 +163,26 @@ class Reline::Config::Test < Reline::TestCase
expected = { 'abcd'.bytes => 'ABCD'.bytes, 'ijkl'.bytes => 'IJKL'.bytes }
assert_equal expected, @config.key_bindings
end
+
+ def test_additional_key_bindings
+ @config.read_lines(<<~'LINES'.lines)
+ "ef": "EF"
+ "gh": "GH"
+ LINES
+
+ expected = { 'ef'.bytes => 'EF'.bytes, 'gh'.bytes => 'GH'.bytes }
+ assert_equal expected, @config.key_bindings
+ end
+
+ def test_additional_key_bindings_with_nesting_and_comment_out
+ @config.read_lines(<<~'LINES'.lines)
+ #"ab": "AB"
+ #"cd": "cd"
+ "ef": "EF"
+ "gh": "GH"
+ LINES
+
+ expected = { 'ef'.bytes => 'EF'.bytes, 'gh'.bytes => 'GH'.bytes }
+ assert_equal expected, @config.key_bindings
+ end
end