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.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/test/reline/test_key_stroke.rb b/test/reline/test_key_stroke.rb
index 224e93d9a0..15675a9b5a 100644
--- a/test/reline/test_key_stroke.rb
+++ b/test/reline/test_key_stroke.rb
@@ -16,10 +16,10 @@ class Reline::KeyStroke::Test < Reline::TestCase
def test_match_status
config = Reline::Config.new
{
- "a" => "xx",
- "ab" => "y",
- "abc" => "z",
- "x" => "rr"
+ 'a' => 'xx',
+ 'ab' => 'y',
+ 'abc' => 'z',
+ 'x' => 'rr'
}.each_pair do |key, func|
config.add_default_key_binding(key.bytes, func.bytes)
end
@@ -35,4 +35,15 @@ class Reline::KeyStroke::Test < Reline::TestCase
assert_equal(:unmatched, stroke.match_status("m".bytes))
assert_equal(:matched, stroke.match_status("abzwabk".bytes))
end
+
+ def test_aaa
+ config = Reline::Config.new
+ {
+ 'abc' => '123',
+ }.each_pair do |key, func|
+ config.add_default_key_binding(key.bytes, func.bytes)
+ end
+ stroke = Reline::KeyStroke.new(config)
+ assert_equal('123'.bytes, stroke.expand('abc'.bytes))
+ end
end