ruby-changes:59714
From: aycabta <ko1@a...>
Date: Fri, 17 Jan 2020 01:37:32 +0900 (JST)
Subject: [ruby-changes:59714] ec0b366a5c (master): Add tests for vi_insert and vi_add
https://git.ruby-lang.org/ruby.git/commit/?id=ec0b366a5c From ec0b366a5c6eadab1315a8f2681a0ef6de20be75 Mon Sep 17 00:00:00 2001 From: aycabta <aycabta@g...> Date: Thu, 16 Jan 2020 20:26:50 +0900 Subject: Add tests for vi_insert and vi_add diff --git a/test/reline/test_key_actor_vi.rb b/test/reline/test_key_actor_vi.rb index 25bc4e9..d46d784 100644 --- a/test/reline/test_key_actor_vi.rb +++ b/test/reline/test_key_actor_vi.rb @@ -24,6 +24,38 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase https://github.com/ruby/ruby/blob/trunk/test/reline/test_key_actor_vi.rb#L24 assert_line('abc') end + def test_vi_insert + assert_instance_of(Reline::KeyActor::ViInsert, @config.editing_mode) + input_keys('i') + assert_line('i') + assert_cursor(1) + assert_instance_of(Reline::KeyActor::ViInsert, @config.editing_mode) + input_keys("\C-[") + assert_line('i') + assert_cursor(0) + assert_instance_of(Reline::KeyActor::ViCommand, @config.editing_mode) + input_keys('i') + assert_line('i') + assert_cursor(0) + assert_instance_of(Reline::KeyActor::ViInsert, @config.editing_mode) + end + + def test_vi_add + assert_instance_of(Reline::KeyActor::ViInsert, @config.editing_mode) + input_keys('a') + assert_line('a') + assert_cursor(1) + assert_instance_of(Reline::KeyActor::ViInsert, @config.editing_mode) + input_keys("\C-[") + assert_line('a') + assert_cursor(0) + assert_instance_of(Reline::KeyActor::ViCommand, @config.editing_mode) + input_keys('a') + assert_line('a') + assert_cursor(1) + assert_instance_of(Reline::KeyActor::ViInsert, @config.editing_mode) + end + def test_ed_insert_one input_keys('a') assert_line('a') -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/