summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-20 16:00:25 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-20 16:00:25 +0200
commita190548e9165bbae75144a3e47f01d7708b29073 (patch)
tree389ae48a682e1d928b244793def5829f9a0ef11e
parentb326edf5b30813b2ccdee3ac07ee6495ca5187ff (diff)
downloadvim-git-a190548e9165bbae75144a3e47f01d7708b29073.tar.gz
patch 8.2.1021: Ruby interface not tested enoughv8.2.1021
Problem: Ruby interface not tested enough. Solution: Add a couple more tests. (Dominique Pellé, closes #6301)
-rw-r--r--src/testdir/test_ruby.vim21
-rw-r--r--src/version.c2
2 files changed, 23 insertions, 0 deletions
diff --git a/src/testdir/test_ruby.vim b/src/testdir/test_ruby.vim
index eee2831ac..321ec4032 100644
--- a/src/testdir/test_ruby.vim
+++ b/src/testdir/test_ruby.vim
@@ -26,6 +26,18 @@ func Test_rubydo()
%bwipe!
endfunc
+func Test_rubydo_dollar_underscore()
+ new
+ call setline(1, ['one', 'two', 'three', 'four'])
+ 2,3rubydo $_ = '[' + $_ + ']'
+ call assert_equal(['one', '[two]', '[three]', 'four'], getline(1, '$'))
+ bwipe!
+
+ call assert_fails('rubydo $_ = 0', 'E265:')
+ call assert_fails('rubydo (')
+ bwipe!
+endfunc
+
func Test_rubyfile()
" Check :rubyfile does not SEGV with Ruby level exception but just fails
let tempfile = tempname() . '.rb'
@@ -395,6 +407,15 @@ func Test_ruby_p()
call assert_equal(0, len(messages))
endfunc
+func Test_rubyeval_error()
+ " On Linux or Windows the error matches:
+ " "syntax error, unexpected end-of-input"
+ " whereas on macOS in CI, the error message makes less sense:
+ " "SyntaxError: array length must be 2"
+ " Unclear why. The test does not check the error message.
+ call assert_fails('call rubyeval("(")')
+endfunc
+
" Test for various heredoc syntax
func Test_ruby_heredoc()
ruby << END
diff --git a/src/version.c b/src/version.c
index b9e6d5bda..94027af0f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1021,
+/**/
1020,
/**/
1019,