summaryrefslogtreecommitdiff
path: root/test/reline/test_key_stroke.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/reline/test_key_stroke.rb')
-rw-r--r--test/reline/test_key_stroke.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/reline/test_key_stroke.rb b/test/reline/test_key_stroke.rb
index e76129d04b..224e93d9a0 100644
--- a/test/reline/test_key_stroke.rb
+++ b/test/reline/test_key_stroke.rb
@@ -14,14 +14,15 @@ class Reline::KeyStroke::Test < Reline::TestCase
}
def test_match_status
- config = {
- key_mapping: {
- "a" => "xx",
- "ab" => "y",
- "abc" => "z",
- "x" => "rr"
- }
- }
+ config = Reline::Config.new
+ {
+ "a" => "xx",
+ "ab" => "y",
+ "abc" => "z",
+ "x" => "rr"
+ }.each_pair do |key, func|
+ config.add_default_key_binding(key.bytes, func.bytes)
+ end
stroke = Reline::KeyStroke.new(config)
assert_equal(:matching, stroke.match_status("a".bytes))
assert_equal(:matching, stroke.match_status("ab".bytes))