patch 9.1.1000: tests: ruby tests fail with Ruby 3.4 Commit: https://github.com/vim/vim/commit/ebea31e454b9a1731cde845226f2c28ca5c097b1 Author: Yee Cheng Chin <ychin....@gmail.com> Date: Thu Jan 9 22:23:29 2025 +0100
patch 9.1.1000: tests: ruby tests fail with Ruby 3.4 Problem: tests: ruby tests fail with Ruby 3.4 Solution: adjust expected output for Ruby 3.4 (Yee Cheng Chin) Vim's Ruby tests relied on explicit matching of output texts which are fragile in design. Ruby 3.4 has changed the output slightly (using 'name' instead of `name', and also using more spaces in dictionary printouts). Modify the Vim tests to be less fragile to such changes. closes: #16411 Signed-off-by: Yee Cheng Chin <ychin....@gmail.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/src/testdir/test_ruby.vim b/src/testdir/test_ruby.vim index f1551685c..cc5f4193f 100644 --- a/src/testdir/test_ruby.vim +++ b/src/testdir/test_ruby.vim @@ -290,7 +290,7 @@ func Test_ruby_Vim_buffer_get() call assert_match('Xfoo1$', rubyeval('Vim::Buffer[1].name')) call assert_match('Xfoo2$', rubyeval('Vim::Buffer[2].name')) call assert_fails('ruby print Vim::Buffer[3].name', - \ "NoMethodError: undefined method `name' for nil") + \ "NoMethodError") %bwipe endfunc @@ -372,7 +372,7 @@ func Test_ruby_Vim_evaluate_dict() redir => l:out ruby d = Vim.evaluate("d"); print d redir END - call assert_equal(['{"a"=>"foo", "b"=>123}'], split(l:out, " ")) + call assert_equal(['{"a"=>"foo","b"=>123}'], split(substitute(l:out, '\s', '', 'g'), " ")) endfunc " Test Vim::message({msg}) (display message {msg}) @@ -391,7 +391,7 @@ func Test_ruby_print() call assert_equal('1.23', RubyPrint('1.23')) call assert_equal('Hello World!', RubyPrint('"Hello World!"')) call assert_equal('[1, 2]', RubyPrint('[1, 2]')) - call assert_equal('{"k1"=>"v1", "k2"=>"v2"}', RubyPrint('({"k1" => "v1", "k2" => "v2"})')) + call assert_equal('{"k1"=>"v1","k2"=>"v2"}', substitute(RubyPrint('({"k1" => "v1", "k2" => "v2"})'), '\s', '', 'g')) call assert_equal('true', RubyPrint('true')) call assert_equal('false', RubyPrint('false')) call assert_equal('', RubyPrint('nil')) diff --git a/src/version.c b/src/version.c index 46b7e3559..baebd2b1c 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1000, /**/ 999, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1tW06P-001CKl-US%40256bit.org.