summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-12-02 03:05:10 +0900
committeraycabta <aycabta@gmail.com>2019-12-02 03:09:41 +0900
commite15b0313a78a6f381720cf362a1a94bda49f62ff (patch)
tree82160d2b24c0873d747cc8cde97fec15da2ac8dc /test
parent4d7a6d04b2c71aabb9d6e619f4405887806a5be8 (diff)
downloadruby-e15b0313a78a6f381720cf362a1a94bda49f62ff.tar.gz
Search history to back in the middle of histories
Diffstat (limited to 'test')
-rw-r--r--test/reline/test_key_actor_emacs.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/reline/test_key_actor_emacs.rb b/test/reline/test_key_actor_emacs.rb
index 776c325afb..da2d41aa15 100644
--- a/test/reline/test_key_actor_emacs.rb
+++ b/test/reline/test_key_actor_emacs.rb
@@ -1430,6 +1430,28 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
assert_cursor_max(0)
end
+ def test_search_history_to_back_in_the_middle_of_histories
+ Reline::HISTORY.concat([
+ '1235', # old
+ '12aa',
+ '1234' # new
+ ])
+ assert_line('')
+ assert_byte_pointer_size('')
+ assert_cursor(0)
+ assert_cursor_max(0)
+ input_keys("\C-p\C-p")
+ assert_line('12aa')
+ assert_byte_pointer_size('12aa')
+ assert_cursor(4)
+ assert_cursor_max(4)
+ input_keys("\C-r123")
+ assert_line('1235')
+ assert_byte_pointer_size('1235')
+ assert_cursor(4)
+ assert_cursor_max(4)
+ end
+
def test_em_set_mark_and_em_exchange_mark
input_keys('aaa bbb ccc ddd')
assert_byte_pointer_size('aaa bbb ccc ddd')