diff options
author | aycabta <aycabta@gmail.com> | 2020-04-25 02:20:52 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-04-29 19:13:14 +0900 |
commit | 4859352df62c05bbc10e1e62f966d493eb771e66 (patch) | |
tree | 7eb38097676d388d84cd677de7a01b3417b80e70 /test/reline/test_history.rb | |
parent | d27fa87418bcec8fff909f75a547a7c5e6dc83e5 (diff) | |
download | ruby-4859352df62c05bbc10e1e62f966d493eb771e66.tar.gz |
[ruby/reline] Negative history_size means unlimited
And unlimited is default.
https://github.com/ruby/reline/commit/f5149c3ca6
Diffstat (limited to 'test/reline/test_history.rb')
-rw-r--r-- | test/reline/test_history.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/reline/test_history.rb b/test/reline/test_history.rb index 0cb148d112..58c240fc96 100644 --- a/test/reline/test_history.rb +++ b/test/reline/test_history.rb @@ -252,6 +252,16 @@ class Reline::History::Test < Reline::TestCase assert_equal 0, history.size end + def test_history_size_negative_unlimited + history = history_new(history_size: -1) + assert_equal 0, history.size + history << 'aa' + history << 'bb' + assert_equal 2, history.size + history.push(*%w{aa bb cc}) + assert_equal 5, history.size + end + private def history_new(history_size: 10) |