1
2func Test_yank_shows_register()
3    enew
4    set report=0
5    call setline(1, ['foo', 'bar'])
6    " Line-wise
7    exe 'norm! yy'
8    call assert_equal('1 line yanked', v:statusmsg)
9    exe 'norm! "zyy'
10    call assert_equal('1 line yanked into "z', v:statusmsg)
11    exe 'norm! yj'
12    call assert_equal('2 lines yanked', v:statusmsg)
13    exe 'norm! "zyj'
14    call assert_equal('2 lines yanked into "z', v:statusmsg)
15
16    " Block-wise
17    exe "norm! \<C-V>y"
18    call assert_equal('block of 1 line yanked', v:statusmsg)
19    exe "norm! \<C-V>\"zy"
20    call assert_equal('block of 1 line yanked into "z', v:statusmsg)
21    exe "norm! \<C-V>jy"
22    call assert_equal('block of 2 lines yanked', v:statusmsg)
23    exe "norm! \<C-V>j\"zy"
24    call assert_equal('block of 2 lines yanked into "z', v:statusmsg)
25
26    bwipe!
27endfunc
28