Skip to content

Commit ebea31e

Browse files
ychinchrisbra
authored andcommitted
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 <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 2051af1 commit ebea31e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/testdir/test_ruby.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func Test_ruby_Vim_buffer_get()
290290
call assert_match('Xfoo1$', rubyeval('Vim::Buffer[1].name'))
291291
call assert_match('Xfoo2$', rubyeval('Vim::Buffer[2].name'))
292292
call assert_fails('ruby print Vim::Buffer[3].name',
293-
\ "NoMethodError: undefined method `name' for nil")
293+
\ "NoMethodError")
294294
%bwipe
295295
endfunc
296296

@@ -372,7 +372,7 @@ func Test_ruby_Vim_evaluate_dict()
372372
redir => l:out
373373
ruby d = Vim.evaluate("d"); print d
374374
redir END
375-
call assert_equal(['{"a"=>"foo", "b"=>123}'], split(l:out, "\n"))
375+
call assert_equal(['{"a"=>"foo","b"=>123}'], split(substitute(l:out, '\s', '', 'g'), "\n"))
376376
endfunc
377377

378378
" Test Vim::message({msg}) (display message {msg})
@@ -391,7 +391,7 @@ func Test_ruby_print()
391391
call assert_equal('1.23', RubyPrint('1.23'))
392392
call assert_equal('Hello World!', RubyPrint('"Hello World!"'))
393393
call assert_equal('[1, 2]', RubyPrint('[1, 2]'))
394-
call assert_equal('{"k1"=>"v1", "k2"=>"v2"}', RubyPrint('({"k1" => "v1", "k2" => "v2"})'))
394+
call assert_equal('{"k1"=>"v1","k2"=>"v2"}', substitute(RubyPrint('({"k1" => "v1", "k2" => "v2"})'), '\s', '', 'g'))
395395
call assert_equal('true', RubyPrint('true'))
396396
call assert_equal('false', RubyPrint('false'))
397397
call assert_equal('', RubyPrint('nil'))

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
1000,
707709
/**/
708710
999,
709711
/**/

0 commit comments

Comments
 (0)