diff src/testdir/test_ruby.vim @ 13148:f06a0a75d5b1 v8.0.1448

patch 8.0.1448: segfault with exception inside :rubyfile command commit https://github.com/vim/vim/commit/37badc898b8d167e11553b6d05908ffd35928a6e Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 31 20:15:30 2018 +0100 patch 8.0.1448: segfault with exception inside :rubyfile command Problem: Segmentation fault when Ruby throws an exception inside :rubyfile command. Solution: Use rb_protect() instead of rb_load_protect(). (ujihisa, closes #2147, greywolf, closes #2512, #2511)
author Christian Brabandt <cb@256bit.org>
date Wed, 31 Jan 2018 20:30:06 +0100
parents 721af7a9b4b4
children c15bef307de6
line wrap: on
line diff
--- a/src/testdir/test_ruby.vim
+++ b/src/testdir/test_ruby.vim
@@ -49,3 +49,11 @@ func Test_rubydo()
   bwipe!
   bwipe!
 endfunc
+
+func Test_rubyfile()
+  " Check :rubyfile does not SEGV with Ruby level exception but just fails
+  let tempfile = tempname() . '.rb'
+  call writefile(['raise "vim!"'], tempfile)
+  call assert_fails('rubyfile ' . tempfile)
+  call delete(tempfile)
+endfunc