comparison src/testdir/test_ruby.vim @ 10761:721af7a9b4b4 v8.0.0270

patch 8.0.0270: may get ml_get error when :rubydo deletes lines commit https://github.com/vim/vim/commit/c593fee0e5e850f7e75be41f5d1751f28892a27f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 29 23:11:25 2017 +0100 patch 8.0.0270: may get ml_get error when :rubydo deletes lines Problem: May get ml_get error when :rubydo deletes lines or switches to another buffer. (Nikolai Pavlov, issue https://github.com/vim/vim/issues/1421) Solution: Check the buffer and line every time.
author Christian Brabandt <cb@256bit.org>
date Sun, 29 Jan 2017 23:15:50 +0100
parents f23feeba7549
children f06a0a75d5b1
comparison
equal deleted inserted replaced
10760:21d42e500b82 10761:721af7a9b4b4
30 redir => l:out 30 redir => l:out
31 ruby d = Vim.evaluate("d"); print d 31 ruby d = Vim.evaluate("d"); print d
32 redir END 32 redir END
33 call assert_equal(['{"a"=>"foo", "b"=>123}'], split(l:out, "\n")) 33 call assert_equal(['{"a"=>"foo", "b"=>123}'], split(l:out, "\n"))
34 endfunc 34 endfunc
35
36 func Test_rubydo()
37 " Check deleting lines does not trigger ml_get error.
38 new
39 call setline(1, ['one', 'two', 'three'])
40 rubydo Vim.command("%d_")
41 bwipe!
42
43 " Check switching to another buffer does not trigger ml_get error.
44 new
45 let wincount = winnr('$')
46 call setline(1, ['one', 'two', 'three'])
47 rubydo Vim.command("new")
48 call assert_equal(wincount + 1, winnr('$'))
49 bwipe!
50 bwipe!
51 endfunc