diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-12-06 17:51:06 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-12-06 17:53:43 -0500 |
commit | 7bb92b7787458d8bc6b5b84eb69986c77a7b2499 (patch) | |
tree | 4c1565e1ea36a5edb44d4c7acc8887d3798c3bf9 /src | |
parent | fb7285b5d7ebf572849a3e742241c3a84c721bb8 (diff) | |
download | rneovim-7bb92b7787458d8bc6b5b84eb69986c77a7b2499.tar.gz rneovim-7bb92b7787458d8bc6b5b84eb69986c77a7b2499.tar.bz2 rneovim-7bb92b7787458d8bc6b5b84eb69986c77a7b2499.zip |
vim-patch:8.2.1021: Ruby interface not tested enough
Problem: Ruby interface not tested enough.
Solution: Add a couple more tests. (Dominique Pellé, closes vim/vim#6301)
https://github.com/vim/vim/commit/a190548e9165bbae75144a3e47f01d7708b29073
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_ruby.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_ruby.vim b/src/nvim/testdir/test_ruby.vim index 9c74c35049..1a274d1fec 100644 --- a/src/nvim/testdir/test_ruby.vim +++ b/src/nvim/testdir/test_ruby.vim @@ -27,6 +27,19 @@ func Test_rubydo() %bwipe! endfunc +func Test_rubydo_dollar_underscore() + throw 'skipped: TODO: ' + 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' @@ -391,3 +404,14 @@ func Test_ruby_p() let messages = GetMessages() 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 + +" vim: shiftwidth=2 sts=2 expandtab |