annotate src/testdir/test_paste.vim @ 10686:23ada4caa13b v8.0.0233

patch 8.0.0233: paste test fails in the GUI commit https://github.com/vim/vim/commit/bff6ad133195145f810645c0bde7a2a1fdfc37b8 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 24 19:18:13 2017 +0100 patch 8.0.0233: paste test fails in the GUI Problem: The paste test fails if the GUI is being used. Solution: Skip the test in the GUI.
author Christian Brabandt <cb@256bit.org>
date Tue, 24 Jan 2017 19:30:04 +0100
parents d564e73ff9ee
children 689e88afdd11
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10682
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for bracketed paste.
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
10686
23ada4caa13b patch 8.0.0233: paste test fails in the GUI
Christian Brabandt <cb@256bit.org>
parents: 10682
diff changeset
3 " Bracketed paste only works with "xterm". Not in GUI.
23ada4caa13b patch 8.0.0233: paste test fails in the GUI
Christian Brabandt <cb@256bit.org>
parents: 10682
diff changeset
4 if has('gui_running')
23ada4caa13b patch 8.0.0233: paste test fails in the GUI
Christian Brabandt <cb@256bit.org>
parents: 10682
diff changeset
5 finish
23ada4caa13b patch 8.0.0233: paste test fails in the GUI
Christian Brabandt <cb@256bit.org>
parents: 10682
diff changeset
6 endif
10682
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 set term=xterm
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 func Test_paste_normal_mode()
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 new
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 call setline(1, ['a', 'b', 'c'])
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 2
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 call feedkeys("\<Esc>[200~foo\<CR>bar\<Esc>[201~", 'xt')
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 call assert_equal('bfoo', getline(2))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 call assert_equal('bar', getline(3))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 call assert_equal('c', getline(4))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 normal .
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 call assert_equal('barfoo', getline(3))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 call assert_equal('bar', getline(4))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 call assert_equal('c', getline(5))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 bwipe!
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 endfunc
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 func Test_paste_insert_mode()
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 new
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 call setline(1, ['a', 'b', 'c'])
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 2
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call feedkeys("i\<Esc>[200~foo\<CR>bar\<Esc>[201~ done\<Esc>", 'xt')
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 call assert_equal('foo', getline(2))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 call assert_equal('bar doneb', getline(3))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 call assert_equal('c', getline(4))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 normal .
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 call assert_equal('bar donfoo', getline(3))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 call assert_equal('bar doneeb', getline(4))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 call assert_equal('c', getline(5))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 bwipe!
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 endfunc
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 func Test_paste_cmdline()
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 call feedkeys(":a\<Esc>[200~foo\<CR>bar\<Esc>[201~b\<Home>\"\<CR>", 'xt')
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 call assert_equal("\"afoo\<CR>barb", getreg(':'))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 endfunc