From 3183b09a5e0cce78be49e08cffb5208cf424e8c1 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 14 Oct 2020 17:50:46 -0400 Subject: 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 --- src/nvim/testdir/test_ruby.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') 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 -- cgit