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)
51e9fbf1c7
This commit is contained in:
Jan Edmund Lazo
2020-10-14 17:50:46 -04:00
parent 4543af9d53
commit 3183b09a5e

View File

@@ -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