annotate src/testdir/test_put.vim @ 26073:948550cae1e7 v8.2.3570

patch 8.2.3570: Test_very_large_count fails on 32bit systems Commit: https://github.com/vim/vim/commit/ec6e63079dde24a1d74b4103775e74d00f9215ec Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 1 22:58:43 2021 +0000 patch 8.2.3570: Test_very_large_count fails on 32bit systems Problem: Test_very_large_count fails on 32bit systems. Solution: Bail out when using 32 bit numbers. (closes https://github.com/vim/vim/issues/9072)
author Bram Moolenaar <Bram@vim.org>
date Tue, 02 Nov 2021 00:00:05 +0100
parents b863efc63397
children a60952e58e5d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
1 " Tests for put commands, e.g. ":put", "p", "gp", "P", "gP", etc.
10664
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
25927
2e82629dbd90 patch 8.2.3497: put test fails when run by itself
Bram Moolenaar <Bram@vim.org>
parents: 25919
diff changeset
3 source check.vim
2e82629dbd90 patch 8.2.3497: put test fails when run by itself
Bram Moolenaar <Bram@vim.org>
parents: 25919
diff changeset
4
10664
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 func Test_put_block()
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 new
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 call feedkeys("i\<C-V>u2500\<CR>x\<ESC>", 'x')
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 call feedkeys("\<C-V>y", 'x')
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 call feedkeys("gg0p", 'x')
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 call assert_equal("\u2500x", getline(1))
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 bwipe!
94db9c08e206 patch 8.0.0222: blockwise put on multi-byte character misplaced
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 endfunc
10670
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
13
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
14 func Test_put_char_block()
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
15 new
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
16 call setline(1, ['Line 1', 'Line 2'])
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
17 f Xfile_put
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
18 " visually select both lines and put the cursor at the top of the visual
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
19 " selection and then put the buffer name over it
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
20 exe "norm! G0\<c-v>ke\"%p"
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
21 call assert_equal(['Xfile_put 1', 'Xfile_put 2'], getline(1,2))
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
22 bw!
bce3eccea39a patch 8.0.0225: put in Visual block mode terminates early
Christian Brabandt <cb@256bit.org>
parents: 10664
diff changeset
23 endfunc
10688
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
24
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
25 func Test_put_char_block2()
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
26 new
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
27 call setreg('a', ' one ', 'v')
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
28 call setline(1, ['Line 1', '', 'Line 3', ''])
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
29 " visually select the first 3 lines and put register a over it
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
30 exe "norm! ggl\<c-v>2j2l\"ap"
21996
808edde1e97d patch 8.2.1547: various comment problems
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
31 call assert_equal(['L one 1', '', 'L one 3', ''], getline(1, 4))
10688
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
32 " clean up
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
33 bw!
3d1872fbecc4 patch 8.0.0234: crash when using put in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10670
diff changeset
34 endfunc
11597
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
35
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
36 func Test_put_lines()
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
37 new
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
38 let a = [ getreg('a'), getregtype('a') ]
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
39 call setline(1, ['Line 1', 'Line2', 'Line 3', ''])
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
40 exe 'norm! gg"add"AddG""p'
21996
808edde1e97d patch 8.2.1547: various comment problems
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
41 call assert_equal(['Line 3', '', 'Line 1', 'Line2'], getline(1, '$'))
11597
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
42 " clean up
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
43 bw!
18000
7a19c8d6bb9e patch 8.1.1996: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17857
diff changeset
44 eval a[0]->setreg('a', a[1])
11597
72b20190dce6 patch 8.0.0681: unnamed register only contains the last deleted text
Christian Brabandt <cb@256bit.org>
parents: 10688
diff changeset
45 endfunc
14009
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
46
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
47 func Test_put_expr()
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
48 new
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
49 call setline(1, repeat(['A'], 6))
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
50 exec "1norm! \"=line('.')\<cr>p"
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
51 norm! j0.
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
52 norm! j0.
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
53 exec "4norm! \"=\<cr>P"
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
54 norm! j0.
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
55 norm! j0.
21996
808edde1e97d patch 8.2.1547: various comment problems
Bram Moolenaar <Bram@vim.org>
parents: 19625
diff changeset
56 call assert_equal(['A1','A2','A3','4A','5A','6A'], getline(1, '$'))
14009
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
57 bw!
830a47e48791 patch 8.1.0022: repeating put from expression register fails
Christian Brabandt <cb@256bit.org>
parents: 11597
diff changeset
58 endfunc
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
59
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
60 func Test_put_fails_when_nomodifiable()
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
61 new
14204
1b9f3932a130 patch 8.1.0119: failing test goes unnoticed because messages is not written
Christian Brabandt <cb@256bit.org>
parents: 14202
diff changeset
62 setlocal nomodifiable
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
63
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
64 normal! yy
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
65 call assert_fails(':put', 'E21:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
66 call assert_fails(':put!', 'E21:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
67 call assert_fails(':normal! p', 'E21:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
68 call assert_fails(':normal! gp', 'E21:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
69 call assert_fails(':normal! P', 'E21:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
70 call assert_fails(':normal! gP', 'E21:')
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
71
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
72 if has('mouse')
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
73 set mouse=n
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21996
diff changeset
74 call assert_fails('execute "normal! \<MiddleMouse>"', 'E21:')
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
75 set mouse&
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
76 endif
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
77
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
78 bwipeout!
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
79 endfunc
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
80
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
81 " A bug was discovered where the Normal mode put commands (e.g., "p") would
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
82 " output duplicate error messages when invoked in a non-modifiable buffer.
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
83 func Test_put_p_errmsg_nodup()
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
84 new
14204
1b9f3932a130 patch 8.1.0119: failing test goes unnoticed because messages is not written
Christian Brabandt <cb@256bit.org>
parents: 14202
diff changeset
85 setlocal nomodifiable
14202
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
86
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
87 normal! yy
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
88
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
89 func Capture_p_error()
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
90 redir => s:p_err
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
91 normal! p
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
92 redir END
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
93 endfunc
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
94
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
95 silent! call Capture_p_error()
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
96
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
97 " Error message output within a function should be three lines (the function
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
98 " name, the line number, and the error message).
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
99 call assert_equal(3, count(s:p_err, "\n"))
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
100
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
101 delfunction Capture_p_error
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
102 bwipeout!
51693b1a640e patch 8.1.0118: duplicate error message for put command
Christian Brabandt <cb@256bit.org>
parents: 14009
diff changeset
103 endfunc
16742
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
104
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
105 func Test_put_p_indent_visual()
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
106 new
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
107 call setline(1, ['select this text', 'select that text'])
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
108 " yank "that" from the second line
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
109 normal 2Gwvey
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
110 " select "this" in the first line and put
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
111 normal k0wve[p
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
112 call assert_equal('select that text', getline(1))
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
113 call assert_equal('select that text', getline(2))
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
114 bwipe!
75b5d77bbbab patch 8.1.1373: "[p" in Visual mode puts in wrong line
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
115 endfunc
19625
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
116
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
117 " Test for deleting all the contents of a buffer with a put
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
118 func Test_put_visual_delete_all_lines()
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
119 new
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
120 call setline(1, ['one', 'two', 'three'])
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
121 let @r = ''
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
122 normal! VG"rgp
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
123 call assert_equal(1, line('$'))
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
124 close!
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
125 endfunc
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
126
25840
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
127 func Test_gp_with_count_leaves_cursor_at_end()
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
128 new
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
129 call setline(1, '<---->')
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
130 call setreg('@', "foo\nbar", 'c')
25842
196f75cf6983 patch 8.2.3455: using a count with "gp" leaves '] in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 25840
diff changeset
131 normal 1G3|3gp
196f75cf6983 patch 8.2.3455: using a count with "gp" leaves '] in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 25840
diff changeset
132 call assert_equal([0, 4, 4, 0], getpos("."))
196f75cf6983 patch 8.2.3455: using a count with "gp" leaves '] in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 25840
diff changeset
133 call assert_equal(['<--foo', 'barfoo', 'barfoo', 'bar-->'], getline(1, '$'))
196f75cf6983 patch 8.2.3455: using a count with "gp" leaves '] in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 25840
diff changeset
134 call assert_equal([0, 4, 3, 0], getpos("']"))
25840
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
135
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
136 bwipe!
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
137 endfunc
8ff483b86d9b patch 8.2.3454: using a count with "gp" leave cursor in wrong position
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
138
26012
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
139 func Test_p_with_count_leaves_mark_at_end()
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
140 new
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
141 call setline(1, '<---->')
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
142 call setreg('@', "start\nend", 'c')
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
143 normal 1G3|3p
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
144 call assert_equal([0, 1, 4, 0], getpos("."))
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
145 call assert_equal(['<--start', 'endstart', 'endstart', 'end-->'], getline(1, '$'))
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
146 call assert_equal([0, 4, 3, 0], getpos("']"))
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
147
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
148 bwipe!
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
149 endfunc
b863efc63397 patch 8.2.3540: the mark '] is wrong after put with a count
Bram Moolenaar <Bram@vim.org>
parents: 25927
diff changeset
150
25919
db5b5c38d222 patch 8.2.3493: large count test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 25917
diff changeset
151 func Test_very_large_count()
db5b5c38d222 patch 8.2.3493: large count test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 25917
diff changeset
152 " FIXME: should actually check if sizeof(int) == sizeof(long)
db5b5c38d222 patch 8.2.3493: large count test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 25917
diff changeset
153 CheckNotMSWindows
db5b5c38d222 patch 8.2.3493: large count test fails on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents: 25917
diff changeset
154
26073
948550cae1e7 patch 8.2.3570: Test_very_large_count fails on 32bit systems
Bram Moolenaar <Bram@vim.org>
parents: 26012
diff changeset
155 if v:numbersize != 64
948550cae1e7 patch 8.2.3570: Test_very_large_count fails on 32bit systems
Bram Moolenaar <Bram@vim.org>
parents: 26012
diff changeset
156 throw 'Skipped: only works with 64 bit numbers'
948550cae1e7 patch 8.2.3570: Test_very_large_count fails on 32bit systems
Bram Moolenaar <Bram@vim.org>
parents: 26012
diff changeset
157 endif
948550cae1e7 patch 8.2.3570: Test_very_large_count fails on 32bit systems
Bram Moolenaar <Bram@vim.org>
parents: 26012
diff changeset
158
25917
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
159 new
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
160 let @" = 'x'
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
161 call assert_fails('norm 44444444444444p', 'E1240:')
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
162 bwipe!
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
163 endfunc
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
164
79a5c8238a5d patch 8.2.3492: crash when pasting too many times
Bram Moolenaar <Bram@vim.org>
parents: 25842
diff changeset
165
19625
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 18000
diff changeset
166 " vim: shiftwidth=2 sts=2 expandtab