1" Tests for register operations
2
3source check.vim
4source view_util.vim
5
6" This test must be executed first to check for empty and unset registers.
7func Test_aaa_empty_reg_test()
8  call assert_fails('normal @@', 'E748:')
9  call assert_fails('normal @%', 'E354:')
10  call assert_fails('normal @#', 'E354:')
11  call assert_fails('normal @!', 'E354:')
12  call assert_fails('normal @:', 'E30:')
13  call assert_fails('normal @.', 'E29:')
14  call assert_fails('put /', 'E35:')
15  call assert_fails('put .', 'E29:')
16endfunc
17
18func Test_yank_shows_register()
19    enew
20    set report=0
21    call setline(1, ['foo', 'bar'])
22    " Line-wise
23    exe 'norm! yy'
24    call assert_equal('1 line yanked', v:statusmsg)
25    exe 'norm! "zyy'
26    call assert_equal('1 line yanked into "z', v:statusmsg)
27    exe 'norm! yj'
28    call assert_equal('2 lines yanked', v:statusmsg)
29    exe 'norm! "zyj'
30    call assert_equal('2 lines yanked into "z', v:statusmsg)
31
32    " Block-wise
33    exe "norm! \<C-V>y"
34    call assert_equal('block of 1 line yanked', v:statusmsg)
35    exe "norm! \<C-V>\"zy"
36    call assert_equal('block of 1 line yanked into "z', v:statusmsg)
37    exe "norm! \<C-V>jy"
38    call assert_equal('block of 2 lines yanked', v:statusmsg)
39    exe "norm! \<C-V>j\"zy"
40    call assert_equal('block of 2 lines yanked into "z', v:statusmsg)
41
42    bwipe!
43endfunc
44
45func Test_display_registers()
46    e file1
47    e file2
48    call setline(1, ['foo', 'bar'])
49    /bar
50    exe 'norm! y2l"axx'
51    call feedkeys("i\<C-R>=2*4\n\<esc>")
52    call feedkeys(":ls\n", 'xt')
53
54    let a = execute('display')
55    let b = execute('registers')
56
57    call assert_equal(a, b)
58    call assert_match('^\nType Name Content\n'
59          \ .         '  c  ""   a\n'
60          \ .         '  c  "0   ba\n'
61          \ .         '  c  "a   b\n'
62          \ .         '.*'
63          \ .         '  c  "-   a\n'
64          \ .         '.*'
65          \ .         '  c  ":   ls\n'
66          \ .         '  c  "%   file2\n'
67          \ .         '  c  "#   file1\n'
68          \ .         '  c  "/   bar\n'
69          \ .         '  c  "=   2\*4', a)
70
71    let a = execute('registers a')
72    call assert_match('^\nType Name Content\n'
73          \ .         '  c  "a   b', a)
74
75    let a = execute('registers :')
76    call assert_match('^\nType Name Content\n'
77          \ .         '  c  ":   ls', a)
78
79    bwipe!
80endfunc
81
82func Test_register_one()
83  " delete a line goes into register one
84  new
85  call setline(1, "one")
86  normal dd
87  call assert_equal("one\n", @1)
88
89  " delete a word does not change register one, does change "-
90  call setline(1, "two")
91  normal de
92  call assert_equal("one\n", @1)
93  call assert_equal("two", @-)
94
95  " delete a word with a register does not change register one
96  call setline(1, "three")
97  normal "ade
98  call assert_equal("three", @a)
99  call assert_equal("one\n", @1)
100
101  " delete a word with register DOES change register one with one of a list of
102  " operators
103  " %
104  call setline(1, ["(12)3"])
105  normal "ad%
106  call assert_equal("(12)", @a)
107  call assert_equal("(12)", @1)
108
109  " (
110  call setline(1, ["first second"])
111  normal $"ad(
112  call assert_equal("first secon", @a)
113  call assert_equal("first secon", @1)
114
115  " )
116  call setline(1, ["First Second."])
117  normal gg0"ad)
118  call assert_equal("First Second.", @a)
119  call assert_equal("First Second.", @1)
120
121  " `
122  call setline(1, ["start here."])
123  normal gg0fhmx0"ad`x
124  call assert_equal("start ", @a)
125  call assert_equal("start ", @1)
126
127  " /
128  call setline(1, ["searchX"])
129  exe "normal gg0\"ad/X\<CR>"
130  call assert_equal("search", @a)
131  call assert_equal("search", @1)
132
133  " ?
134  call setline(1, ["Ysearch"])
135  exe "normal gg$\"ad?Y\<CR>"
136  call assert_equal("Ysearc", @a)
137  call assert_equal("Ysearc", @1)
138
139  " n
140  call setline(1, ["Ynext"])
141  normal gg$"adn
142  call assert_equal("Ynex", @a)
143  call assert_equal("Ynex", @1)
144
145  " N
146  call setline(1, ["prevY"])
147  normal gg0"adN
148  call assert_equal("prev", @a)
149  call assert_equal("prev", @1)
150
151  " }
152  call setline(1, ["one", ""])
153  normal gg0"ad}
154  call assert_equal("one\n", @a)
155  call assert_equal("one\n", @1)
156
157  " {
158  call setline(1, ["", "two"])
159  normal 2G$"ad{
160  call assert_equal("\ntw", @a)
161  call assert_equal("\ntw", @1)
162
163  bwipe!
164endfunc
165
166func Test_recording_status_in_ex_line()
167  norm qx
168  redraw!
169  call assert_equal('recording @x', Screenline(&lines))
170  set shortmess=q
171  redraw!
172  call assert_equal('recording', Screenline(&lines))
173  set shortmess&
174  norm q
175  redraw!
176  call assert_equal('', Screenline(&lines))
177endfunc
178
179" Check that replaying a typed sequence does not use an Esc and following
180" characters as an escape sequence.
181func Test_recording_esc_sequence()
182  new
183  try
184    let save_F2 = &t_F2
185  catch
186  endtry
187  let t_F2 = "\<Esc>OQ"
188  call feedkeys("qqiTest\<Esc>", "xt")
189  call feedkeys("OQuirk\<Esc>q", "xt")
190  call feedkeys("Go\<Esc>@q", "xt")
191  call assert_equal(['Quirk', 'Test', 'Quirk', 'Test'], getline(1, 4))
192  bwipe!
193  if exists('save_F2')
194    let &t_F2 = save_F2
195  else
196    set t_F2=
197  endif
198endfunc
199
200" Test for executing the last used register (@)
201func Test_last_used_exec_reg()
202  " Test for the @: command
203  let a = ''
204  call feedkeys(":let a ..= 'Vim'\<CR>", 'xt')
205  normal @:
206  call assert_equal('VimVim', a)
207
208  " Test for the @= command
209  let x = ''
210  let a = ":let x ..= 'Vim'\<CR>"
211  exe "normal @=a\<CR>"
212  normal @@
213  call assert_equal('VimVim', x)
214
215  " Test for the @. command
216  let a = ''
217  call feedkeys("i:let a ..= 'Edit'\<CR>", 'xt')
218  normal @.
219  normal @@
220  call assert_equal('EditEdit', a)
221
222  " Test for repeating the last command-line in visual mode
223  call append(0, 'register')
224  normal gg
225  let @r = ''
226  call feedkeys("v:yank R\<CR>", 'xt')
227  call feedkeys("v@:", 'xt')
228  call assert_equal("\nregister\nregister\n", @r)
229
230  enew!
231endfunc
232
233func Test_get_register()
234  enew
235  edit Xfile1
236  edit Xfile2
237  call assert_equal('Xfile2', getreg('%'))
238  call assert_equal('Xfile1', getreg('#'))
239
240  call feedkeys("iTwo\<Esc>", 'xt')
241  call assert_equal('Two', getreg('.'))
242  call assert_equal('', getreg('_'))
243  call assert_beeps('normal ":yy')
244  call assert_beeps('normal "%yy')
245  call assert_beeps('normal ".yy')
246
247  call assert_equal('', getreg("\<C-F>"))
248  call assert_equal('', getreg("\<C-W>"))
249  call assert_equal('', getreg("\<C-L>"))
250  " Change the last used register to '"' for the next test
251  normal! ""yy
252  let @" = 'happy'
253  call assert_equal('happy', getreg())
254  call assert_equal('happy', getreg(''))
255
256  call assert_equal('', getregtype('!'))
257  call assert_fails('echo getregtype([])', 'E730:')
258  call assert_equal('v', getregtype())
259  call assert_equal('v', getregtype(''))
260
261  " Test for inserting an invalid register content
262  call assert_beeps('exe "normal i\<C-R>!"')
263
264  " Test for inserting a register with multiple lines
265  call deletebufline('', 1, '$')
266  call setreg('r', ['a', 'b'])
267  exe "normal i\<C-R>r"
268  call assert_equal(['a', 'b', ''], getline(1, '$'))
269
270  " Test for inserting a multi-line register in the command line
271  call feedkeys(":\<C-R>r\<Esc>", 'xt')
272  call assert_equal("a\rb\r", histget(':', -1))
273
274  call assert_fails('let r = getreg("=", [])', 'E745:')
275  call assert_fails('let r = getreg("=", 1, [])', 'E745:')
276  enew!
277
278  " Using a register in operator-pending mode should fail
279  call assert_beeps('norm! c"')
280endfunc
281
282func Test_set_register()
283  call assert_fails("call setreg('#', 200)", 'E86:')
284  call assert_fails("call setreg('a', test_unknown())", 'E908:')
285
286  edit Xfile_alt_1
287  let b1 = bufnr('')
288  edit Xfile_alt_2
289  let b2 = bufnr('')
290  edit Xfile_alt_3
291  let b3 = bufnr('')
292  call setreg('#', 'alt_1')
293  call assert_equal('Xfile_alt_1', getreg('#'))
294  call setreg('#', b2)
295  call assert_equal('Xfile_alt_2', getreg('#'))
296
297  let ab = 'regwrite'
298  call setreg('=', '')
299  call setreg('=', 'a', 'a')
300  call setreg('=', 'b', 'a')
301  call assert_equal('regwrite', getreg('='))
302
303  " Test for setting a list of lines to special registers
304  call setreg('/', [])
305  call assert_equal('', @/)
306  call setreg('=', [])
307  call assert_equal('', @=)
308  call assert_fails("call setreg('/', ['a', 'b'])", 'E883:')
309  call assert_fails("call setreg('=', ['a', 'b'])", 'E883:')
310  call assert_equal(0, setreg('_', ['a', 'b']))
311
312  " Test for recording to a invalid register
313  call assert_beeps('normal q$')
314
315  " Appending to a register when recording
316  call append(0, "text for clipboard test")
317  normal gg
318  call feedkeys('qrllq', 'xt')
319  call feedkeys('qRhhq', 'xt')
320  call assert_equal('llhh', getreg('r'))
321
322  " Appending a list of characters to a register from different lines
323  let @r = ''
324  call append(0, ['abcdef', '123456'])
325  normal gg"ry3l
326  call cursor(2, 4)
327  normal "Ry3l
328  call assert_equal('abc456', @r)
329
330  " Test for gP with multiple lines selected using characterwise motion
331  %delete
332  call append(0, ['vim editor', 'vim editor'])
333  let @r = ''
334  exe "normal ggwy/vim /e\<CR>gP"
335  call assert_equal(['vim editor', 'vim editor', 'vim editor'], getline(1, 3))
336
337  " Test for gP with . register
338  %delete
339  normal iabc
340  normal ".gp
341  call assert_equal('abcabc', getline(1))
342  normal 0".gP
343  call assert_equal('abcabcabc', getline(1))
344
345  let @"=''
346  call setreg('', '1')
347  call assert_equal('1', @")
348  call setreg('@', '2')
349  call assert_equal('2', @")
350
351  enew!
352endfunc
353
354" Test for clipboard registers (* and +)
355func Test_clipboard_regs()
356  CheckNotGui
357  CheckFeature clipboard_working
358
359  new
360  call append(0, "text for clipboard test")
361  normal gg"*yiw
362  call assert_equal('text', getreg('*'))
363  normal gg2w"+yiw
364  call assert_equal('clipboard', getreg('+'))
365
366  " Test for replacing the clipboard register contents
367  set clipboard=unnamed
368  let @* = 'food'
369  normal ggviw"*p
370  call assert_equal('text', getreg('*'))
371  call assert_equal('food for clipboard test', getline(1))
372  normal ggviw"*p
373  call assert_equal('food', getreg('*'))
374  call assert_equal('text for clipboard test', getline(1))
375
376  " Test for replacing the selection register contents
377  set clipboard=unnamedplus
378  let @+ = 'food'
379  normal ggviw"+p
380  call assert_equal('text', getreg('+'))
381  call assert_equal('food for clipboard test', getline(1))
382  normal ggviw"+p
383  call assert_equal('food', getreg('+'))
384  call assert_equal('text for clipboard test', getline(1))
385
386  " Test for auto copying visually selected text to clipboard register
387  call setline(1, "text for clipboard test")
388  let @* = ''
389  set clipboard=autoselect
390  normal ggwwviwy
391  call assert_equal('clipboard', @*)
392
393  " Test for auto copying visually selected text to selection register
394  let @+ = ''
395  set clipboard=autoselectplus
396  normal ggwviwy
397  call assert_equal('for', @+)
398
399  set clipboard&vim
400  bwipe!
401endfunc
402
403" Test for restarting the current mode (insert or virtual replace) after
404" executing the contents of a register
405func Test_put_reg_restart_mode()
406  new
407  call append(0, 'editor')
408  normal gg
409  let @r = "ivim \<Esc>"
410  call feedkeys("i\<C-O>@r\<C-R>=mode()\<CR>", 'xt')
411  call assert_equal('vimi editor', getline(1))
412
413  call setline(1, 'editor')
414  normal gg
415  call feedkeys("gR\<C-O>@r\<C-R>=mode()\<CR>", 'xt')
416  call assert_equal('vimReditor', getline(1))
417
418  bwipe!
419endfunc
420
421" Test for executing a register using :@ command
422func Test_execute_register()
423  call setreg('r', [])
424  call assert_beeps('@r')
425  let i = 1
426  let @q = 'let i+= 1'
427  @q
428  @
429  call assert_equal(3, i)
430
431  " try to execute expression register and use a backspace to cancel it
432  new
433  call feedkeys("@=\<BS>ax\<CR>y", 'xt')
434  call assert_equal(['x', 'y'], getline(1, '$'))
435  close!
436
437  " cannot execute a register in operator pending mode
438  call assert_beeps('normal! c@r')
439endfunc
440
441" Test for getting register info
442func Test_get_reginfo()
443  enew
444  call setline(1, ['foo', 'bar'])
445
446  exe 'norm! "zyy'
447  let info = getreginfo('"')
448  call assert_equal('z', info.points_to)
449  call setreg('y', 'baz')
450  call assert_equal('z', getreginfo('').points_to)
451  call setreg('y', { 'isunnamed': v:true })
452  call assert_equal('y', getreginfo('"').points_to)
453
454  exe '$put'
455  call assert_equal(getreg('y'), getline(3))
456  call setreg('', 'qux')
457  call assert_equal('0', getreginfo('').points_to)
458  call setreg('x', 'quux')
459  call assert_equal('0', getreginfo('').points_to)
460
461  let info = getreginfo('')
462  call assert_equal(getreg('', 1, 1), info.regcontents)
463  call assert_equal(getregtype(''), info.regtype)
464
465  exe "norm! 0\<c-v>e" .. '"zy'
466  let info = getreginfo('z')
467  call assert_equal(getreg('z', 1, 1), info.regcontents)
468  call assert_equal(getregtype('z'), info.regtype)
469  call assert_equal(1, +info.isunnamed)
470
471  let info = getreginfo('"')
472  call assert_equal('z', info.points_to)
473
474  let @a="a1b2"
475  nnoremap <F2> <Cmd>let g:RegInfo = getreginfo()<CR>
476  exe "normal \"a\<F2>"
477  call assert_equal({'regcontents': ['a1b2'], 'isunnamed': v:false,
478        \ 'regtype': 'v'}, g:RegInfo)
479  nunmap <F2>
480  unlet g:RegInfo
481
482  bwipe!
483endfunc
484
485" Test for restoring register with dict from getreginfo
486func Test_set_register_dict()
487  enew!
488
489  call setreg('"', #{ regcontents: ['one', 'two'],
490        \ regtype: 'V', points_to: 'z' })
491  call assert_equal(['one', 'two'], getreg('"', 1, 1))
492  let info = getreginfo('"')
493  call assert_equal('z', info.points_to)
494  call assert_equal('V', info.regtype)
495  call assert_equal(1, +getreginfo('z').isunnamed)
496
497  call setreg('x', #{ regcontents: ['three', 'four'],
498        \ regtype: 'v', isunnamed: v:true })
499  call assert_equal(['three', 'four'], getreg('"', 1, 1))
500  let info = getreginfo('"')
501  call assert_equal('x', info.points_to)
502  call assert_equal('v', info.regtype)
503  call assert_equal(1, +getreginfo('x').isunnamed)
504
505  call setreg('y', #{ regcontents: 'five',
506        \ regtype: "\<c-v>", isunnamed: v:false })
507  call assert_equal("\<c-v>4", getreginfo('y').regtype)
508  call assert_equal(0, +getreginfo('y').isunnamed)
509  call assert_equal(['three', 'four'], getreg('"', 1, 1))
510  call assert_equal('x', getreginfo('"').points_to)
511
512  call setreg('"', #{ regcontents: 'six' })
513  call assert_equal('0', getreginfo('"').points_to)
514  call assert_equal(1, +getreginfo('0').isunnamed)
515  call assert_equal(['six'], getreginfo('0').regcontents)
516  call assert_equal(['six'], getreginfo('"').regcontents)
517
518  let @x = 'one'
519  call setreg('x', {})
520  call assert_equal(1, len(split(execute('reg x'), '\n')))
521
522  call assert_fails("call setreg('0', #{regtype: 'V'}, 'v')", 'E118:')
523  call assert_fails("call setreg('0', #{regtype: 'X'})", 'E475:')
524  call assert_fails("call setreg('0', #{regtype: 'vy'})", 'E475:')
525
526  bwipe!
527endfunc
528
529func Test_v_register()
530  enew
531  call setline(1, 'nothing')
532
533  func s:Put()
534    let s:register = v:register
535    exec 'normal! "' .. v:register .. 'P'
536  endfunc
537  nnoremap <buffer> <plug>(test) :<c-u>call s:Put()<cr>
538  nmap <buffer> S <plug>(test)
539
540  let @z = "testz\n"
541  let @" = "test@\n"
542
543  let s:register = ''
544  call feedkeys('"_ddS', 'mx')
545  call assert_equal('test@', getline('.'))  " fails before 8.2.0929
546  call assert_equal('"', s:register)        " fails before 8.2.0929
547
548  let s:register = ''
549  call feedkeys('"zS', 'mx')
550  call assert_equal('z', s:register)
551
552  let s:register = ''
553  call feedkeys('"zSS', 'mx')
554  call assert_equal('"', s:register)
555
556  let s:register = ''
557  call feedkeys('"_S', 'mx')
558  call assert_equal('_', s:register)
559
560  let s:register = ''
561  normal "_ddS
562  call assert_equal('"', s:register)        " fails before 8.2.0929
563  call assert_equal('test@', getline('.'))  " fails before 8.2.0929
564
565  let s:register = ''
566  execute 'normal "z:call' "s:Put()\n"
567  call assert_equal('z', s:register)
568  call assert_equal('testz', getline('.'))
569
570  " Test operator and omap
571  let @b = 'testb'
572  func s:OpFunc(...)
573    let s:register2 = v:register
574  endfunc
575  set opfunc=s:OpFunc
576
577  normal "bg@l
578  normal S
579  call assert_equal('"', s:register)        " fails before 8.2.0929
580  call assert_equal('b', s:register2)
581
582  func s:Motion()
583    let s:register1 = v:register
584    normal! l
585  endfunc
586  onoremap <buffer> Q :<c-u>call s:Motion()<cr>
587
588  normal "bg@Q
589  normal S
590  call assert_equal('"', s:register)
591  call assert_equal('b', s:register1)
592  call assert_equal('"', s:register2)
593
594  set opfunc&
595  bwipe!
596endfunc
597
598" Test for executing the contents of a register as an Ex command with line
599" continuation.
600func Test_execute_reg_as_ex_cmd()
601  " Line continuation with just two lines
602  let code =<< trim END
603    let l = [
604      \ 1]
605  END
606  let @r = code->join("\n")
607  let l = []
608  @r
609  call assert_equal([1], l)
610
611  " Line continuation with more than two lines
612  let code =<< trim END
613    let l = [
614      \ 1,
615      \ 2,
616      \ 3]
617  END
618  let @r = code->join("\n")
619  let l = []
620  @r
621  call assert_equal([1, 2, 3], l)
622
623  " use comments interspersed with code
624  let code =<< trim END
625    let l = [
626      "\ one
627      \ 1,
628      "\ two
629      \ 2,
630      "\ three
631      \ 3]
632  END
633  let @r = code->join("\n")
634  let l = []
635  @r
636  call assert_equal([1, 2, 3], l)
637
638  " use line continuation in the middle
639  let code =<< trim END
640    let a = "one"
641    let l = [
642      \ 1,
643      \ 2]
644    let b = "two"
645  END
646  let @r = code->join("\n")
647  let l = []
648  @r
649  call assert_equal([1, 2], l)
650  call assert_equal("one", a)
651  call assert_equal("two", b)
652
653  " only one line with a \
654  let @r = "\\let l = 1"
655  call assert_fails('@r', 'E10:')
656
657  " only one line with a "\
658  let @r = '   "\ let i = 1'
659  @r
660  call assert_false(exists('i'))
661
662  " first line also begins with a \
663  let @r = "\\let l = [\n\\ 1]"
664  call assert_fails('@r', 'E10:')
665
666  " Test with a large number of lines
667  let @r = "let str = \n"
668  let @r ..= repeat("  \\ 'abcdefghijklmnopqrstuvwxyz' ..\n", 312)
669  let @r ..= '  \ ""'
670  @r
671  call assert_equal(repeat('abcdefghijklmnopqrstuvwxyz', 312), str)
672endfunc
673
674" Test for clipboard registers with ASCII NUL
675func Test_clipboard_nul()
676  CheckFeature clipboard_working
677  new
678
679  " Test for putting ASCII NUL into the clipboard
680  set clipboard=unnamed
681  call append(0, "\ntest")
682  normal ggyyp
683  call assert_equal("^@test^@", strtrans(getreg('*')))
684  call assert_equal(getline(1), getline(2))
685  let b = split(execute(":reg *"), "\n")
686  call assert_match('"\*\s*\^@test\^J',b[1])
687
688  set clipboard&vim
689  bwipe!
690endfunc
691
692func Test_ve_blockpaste()
693  new
694  set ve=all
695  0put =['QWERTZ','ASDFGH']
696  call cursor(1,1)
697  exe ":norm! \<C-V>3ljdP"
698  call assert_equal(1, col('.'))
699  call assert_equal(getline(1, 2), ['QWERTZ', 'ASDFGH'])
700  call cursor(1,1)
701  exe ":norm! \<C-V>3ljd"
702  call cursor(1,1)
703  norm! $3lP
704  call assert_equal(5, col('.'))
705  call assert_equal(getline(1, 2), ['TZ  QWER', 'GH  ASDF'])
706  set ve&vim
707  bwipe!
708endfunc
709
710func Test_insert_small_delete()
711  new
712  call setline(1, ['foo foobar bar'])
713  call cursor(1,1)
714  exe ":norm! ciw'\<C-R>-'"
715  call assert_equal("'foo' foobar bar", getline(1))
716  exe ":norm! w.w."
717  call assert_equal("'foo' 'foobar' 'bar'", getline(1))
718  bwipe!
719endfunc
720
721" Record in insert mode using CTRL-O
722func Test_record_in_insert_mode()
723  new
724  let @r = ''
725  call setline(1, ['foo'])
726  call feedkeys("i\<C-O>qrbaz\<C-O>q", 'xt')
727  call assert_equal('baz', @r)
728  bwipe!
729endfunc
730
731" Make sure that y_append is correctly reset
732" and the previous register is working as expected
733func Test_register_y_append_reset()
734  new
735  call setline(1, ['1',
736    \ '2 ----------------------------------------------------',
737    \ '3',
738    \ '4',
739    \ '5 ----------------------------------------------------',
740    \ '6',
741    \ '7',
742    \ '8 ----------------------------------------------------',
743    \ '9',
744    \ '10 aaaaaaa 4.',
745    \ '11 Game Dbl-Figures Leaders:',
746    \ '12 Player Pts FG% 3P% FT% RB AS BL ST TO PF EFF',
747    \ '13 bbbbbbbbb 12 (50 /0 /67 )/ 7/ 3/ 0/ 2/ 3/ 4/+15',
748    \ '14 cccccc 12 (57 /67 /100)/ 2/ 1/ 1/ 0/ 1/ 3/+12',
749    \ '15 ddddddd 10 (63 /0 /0 )/ 1/ 3/ 0/ 3/ 5/ 3/ +9',
750    \ '16 4 5-15 0-3 2-2 5-12 1-1 3-4 33.3 0.0 100 41.7 100 75 12 14',
751    \ '17 F 23-55 2-10 9-11 23-52 3-13 26-29 41.8 20 81.8 44.2 23.1 89.7 57 75',
752    \ '18 4 3 6 3 2 3 3 4 3 3 7 3 1 4 6 -1 -1 +2 -1 -2',
753    \ '19 F 13 19 5 10 4 17 22 9 14 32 13 4 20 17 -1 -13 -4 -3 -3 +5'])
754  11
755  exe "norm! \"a5dd"
756  norm! j
757  exe "norm! \"bY"
758  norm! 2j
759  exe "norm! \"BY"
760  norm! 4k
761  norm! 5dd
762  norm! 3k
763  " The next put should put the content of the unnamed register, not of
764  " register b!
765  norm! p
766  call assert_equal(['1',
767    \ '2 ----------------------------------------------------',
768    \ '3',
769    \ '4',
770    \ '5 ----------------------------------------------------',
771    \ '6',
772    \ '10 aaaaaaa 4.',
773    \ '16 4 5-15 0-3 2-2 5-12 1-1 3-4 33.3 0.0 100 41.7 100 75 12 14',
774    \ '17 F 23-55 2-10 9-11 23-52 3-13 26-29 41.8 20 81.8 44.2 23.1 89.7 57 75',
775    \ '18 4 3 6 3 2 3 3 4 3 3 7 3 1 4 6 -1 -1 +2 -1 -2',
776    \ '19 F 13 19 5 10 4 17 22 9 14 32 13 4 20 17 -1 -13 -4 -3 -3 +5',
777    \ '7',
778    \ '8 ----------------------------------------------------',
779    \ '9'], getline(1,'$'))
780  bwipe!
781endfunc
782
783" vim: shiftwidth=2 sts=2 expandtab
784