aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-14 17:50:46 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-14 22:00:40 -0400
commit3183b09a5e0cce78be49e08cffb5208cf424e8c1 (patch)
tree81d7f6880c7d05ff6985a1101d56c25ffc6a2aa0
parent4543af9d53bc5a222a7ac01e17e2ad8a8ed63c8e (diff)
downloadrneovim-3183b09a5e0cce78be49e08cffb5208cf424e8c1.tar.gz
rneovim-3183b09a5e0cce78be49e08cffb5208cf424e8c1.tar.bz2
rneovim-3183b09a5e0cce78be49e08cffb5208cf424e8c1.zip
vim-patch:8.1.0269: Ruby Kernel.#p method always returns nil
Problem: Ruby Kernel.#p method always returns nil. Solution: Copy p method implementation from Ruby code. (Masataka Pocke Kuwabara, closes vim/vim#3315) https://github.com/vim/vim/commit/51e9fbf1c7ab4ec61ac959d72d5d5cb0a0b356bb
-rw-r--r--src/nvim/testdir/test_ruby.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_ruby.vim b/src/nvim/testdir/test_ruby.vim
index 00b362a9ec..77a42e0a8a 100644
--- a/src/nvim/testdir/test_ruby.vim
+++ b/src/nvim/testdir/test_ruby.vim
@@ -370,4 +370,17 @@ func Test_p()
ruby p 'Just a test'
let messages = split(execute('message'), "\n")
call assert_equal('"Just a test"', messages[-1])
+
+ " Check return values of p method
+
+ call assert_equal('123', RubyEval('p(123)'))
+ call assert_equal('[1, 2, 3]', RubyEval('p(1, 2, 3)'))
+
+ " Avoid the "message maintainer" line.
+ let $LANG = ''
+ messages clear
+ call assert_equal('true', RubyEval('p() == nil'))
+
+ let messages = split(execute('message'), "\n")
+ call assert_equal(0, len(messages))
endfunc