0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

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 #3315)
This commit is contained in:
Bram Moolenaar
2018-08-11 14:24:11 +02:00
parent d569bb0299
commit 51e9fbf1c7
3 changed files with 33 additions and 1 deletions

View File

@@ -363,4 +363,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