summaryrefslogtreecommitdiff
path: root/src/testdir/test_ruby.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-08-11 14:24:11 +0200
committerBram Moolenaar <Bram@vim.org>2018-08-11 14:24:11 +0200
commit51e9fbf1c7ab4ec61ac959d72d5d5cb0a0b356bb (patch)
tree074ca64b1811dbccb885d6e8a9ba1e2d1bdc33b2 /src/testdir/test_ruby.vim
parentd569bb029983cff947dce704e6f830276204c13f (diff)
downloadvim-git-51e9fbf1c7ab4ec61ac959d72d5d5cb0a0b356bb.tar.gz
patch 8.1.0269: Ruby Kernel.#p method always returns nilv8.1.0269
Problem: Ruby Kernel.#p method always returns nil. Solution: Copy p method implementation from Ruby code. (Masataka Pocke Kuwabara, closes #3315)
Diffstat (limited to 'src/testdir/test_ruby.vim')
-rw-r--r--src/testdir/test_ruby.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_ruby.vim b/src/testdir/test_ruby.vim
index 8d7943e17..5476e5171 100644
--- a/src/testdir/test_ruby.vim
+++ b/src/testdir/test_ruby.vim
@@ -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