Skip to content

Commit

Permalink
Fix that Test_ruby_p fails on Windows after 8.2.0636
Browse files Browse the repository at this point in the history
Discussed at vim@41f6918 .
  • Loading branch information
k-takata committed Apr 30, 2020
1 parent 8dbafd0 commit aa3d4dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 12 additions & 0 deletions src/testdir/shared.vim
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,16 @@ func IsRoot()
return v:false
endfunc

" Get all messages but drop the maintainer entry.
func GetMessages()
redir => result
redraw | messages
redir END
let msg_list = split(result, "\n")
if msg_list->len() > 0 && msg_list[0] =~ 'Messages maintainer:'
return msg_list[1:]
endif
return msg_list
endfunc

" vim: shiftwidth=2 sts=2 expandtab
12 changes: 0 additions & 12 deletions src/testdir/test_messages.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@
source shared.vim
source term_util.vim

" Get all messages but drop the maintainer entry.
func GetMessages()
redir => result
redraw | messages
redir END
let msg_list = split(result, "\n")
if msg_list->len() > 0 && msg_list[0] =~ 'Messages maintainer:'
return msg_list[1:]
endif
return msg_list
endfunc

func Test_messages()
let oldmore = &more
try
Expand Down
4 changes: 2 additions & 2 deletions src/testdir/test_ruby.vim
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ endfunc

func Test_ruby_p()
ruby p 'Just a test'
let messages = split(execute('message'), "\n")
let messages = GetMessages()
call assert_equal('"Just a test"', messages[-1])

" Check return values of p method
Expand All @@ -391,7 +391,7 @@ func Test_ruby_p()
messages clear
call assert_equal(v:true, rubyeval('p() == nil'))

let messages = split(execute('message'), "\n")
let messages = GetMessages()
call assert_equal(0, len(messages))
endfunc

Expand Down

0 comments on commit aa3d4dc

Please sign in to comment.