annotate src/testdir/test_mksession.vim @ 14646:aa48ee3d3d12 v8.1.0336

patch 8.1.0336: mkview test still fails on CI commit https://github.com/vim/vim/commit/dd5d18eadffadc723ff7d3e208a2973d267a6dde Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 30 14:16:06 2018 +0200 patch 8.1.0336: mkview test still fails on CI Problem: mkview test still fails on CI. Solution: Ignore curswant, don't see another solution.
author Christian Brabandt <cb@256bit.org>
date Thu, 30 Aug 2018 14:30:06 +0200
parents 3d94bbf54530
children 1c6a708a5fee
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for :mksession, :mkview and :loadview in latin1 encoding
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 set encoding=latin1
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 scriptencoding latin1
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 if !has('multi_byte') || !has('mksession')
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 finish
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 endif
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9
13435
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
10 source shared.vim
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
11
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 func Test_mksession()
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 tabnew
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 let wrap_save = &wrap
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 set sessionoptions=buffers splitbelow fileencoding=latin1
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 call setline(1, [
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 \ 'start:',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 \ 'no multibyte chAracter',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 \ ' one leaDing tab',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 \ ' four leadinG spaces',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ 'two consecutive tabs',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ 'two tabs in one line',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 \ 'one ä multibyteCharacter',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 \ 'aä Ä two multiByte characters',
14640
22248c686b32 patch 8.1.0333: :mkview does not restore cursor properly after "$"
Christian Brabandt <cb@256bit.org>
parents: 14635
diff changeset
25 \ 'Aäöü three mulTibyte characters',
22248c686b32 patch 8.1.0333: :mkview does not restore cursor properly after "$"
Christian Brabandt <cb@256bit.org>
parents: 14635
diff changeset
26 \ 'short line',
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 \ ])
10737
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
28 let tmpfile = 'Xtemp'
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 exec 'w! ' . tmpfile
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 /^start:
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 set wrap
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 vsplit
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 norm! j8|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 norm! j8|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 norm! j16|
14640
22248c686b32 patch 8.1.0333: :mkview does not restore cursor properly after "$"
Christian Brabandt <cb@256bit.org>
parents: 14635
diff changeset
48 split
22248c686b32 patch 8.1.0333: :mkview does not restore cursor properly after "$"
Christian Brabandt <cb@256bit.org>
parents: 14635
diff changeset
49 norm! j$
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 wincmd l
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 set nowrap
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 /^start:
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 norm! j16|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 norm! j08|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 norm! j08|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 call wincol()
10737
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
71 mksession! Xtest_mks.out
14640
22248c686b32 patch 8.1.0333: :mkview does not restore cursor properly after "$"
Christian Brabandt <cb@256bit.org>
parents: 14635
diff changeset
72 let li = filter(readfile('Xtest_mks.out'), 'v:val =~# "\\(^ *normal! [0$]\\|^ *exe ''normal!\\)"')
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 let expected = [
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 \ 'normal! 016|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 \ 'normal! 016|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 \ 'normal! 016|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 \ 'normal! 08|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 \ 'normal! 08|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 \ 'normal! 016|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 \ 'normal! 016|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 \ 'normal! 016|',
14640
22248c686b32 patch 8.1.0333: :mkview does not restore cursor properly after "$"
Christian Brabandt <cb@256bit.org>
parents: 14635
diff changeset
82 \ 'normal! $',
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 \ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 \ " normal! 08|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 \ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 \ " normal! 08|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 \ " normal! 016|"
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 \ ]
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102 call assert_equal(expected, li)
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 tabclose!
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104
10737
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
105 call delete('Xtest_mks.out')
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 call delete(tmpfile)
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107 let &wrap = wrap_save
13435
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
108 set sessionoptions&
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 endfunc
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110
10726
78927b31c73a patch 8.0.0253: error when loading session if winminheight is 2
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
111 func Test_mksession_winheight()
78927b31c73a patch 8.0.0253: error when loading session if winminheight is 2
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
112 new
14057
be8fb2fd51fc patch 8.1.0046: loading a session file fails if 'winheight' is big
Christian Brabandt <cb@256bit.org>
parents: 13435
diff changeset
113 set winheight=10
be8fb2fd51fc patch 8.1.0046: loading a session file fails if 'winheight' is big
Christian Brabandt <cb@256bit.org>
parents: 13435
diff changeset
114 set winminheight=2
10737
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
115 mksession! Xtest_mks.out
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
116 source Xtest_mks.out
10726
78927b31c73a patch 8.0.0253: error when loading session if winminheight is 2
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
117
10737
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
118 call delete('Xtest_mks.out')
10726
78927b31c73a patch 8.0.0253: error when loading session if winminheight is 2
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
119 endfunc
78927b31c73a patch 8.0.0253: error when loading session if winminheight is 2
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
120
14057
be8fb2fd51fc patch 8.1.0046: loading a session file fails if 'winheight' is big
Christian Brabandt <cb@256bit.org>
parents: 13435
diff changeset
121 func Test_mksession_large_winheight()
be8fb2fd51fc patch 8.1.0046: loading a session file fails if 'winheight' is big
Christian Brabandt <cb@256bit.org>
parents: 13435
diff changeset
122 set winheight=999
be8fb2fd51fc patch 8.1.0046: loading a session file fails if 'winheight' is big
Christian Brabandt <cb@256bit.org>
parents: 13435
diff changeset
123 mksession! Xtest_mks_winheight.out
be8fb2fd51fc patch 8.1.0046: loading a session file fails if 'winheight' is big
Christian Brabandt <cb@256bit.org>
parents: 13435
diff changeset
124 set winheight&
be8fb2fd51fc patch 8.1.0046: loading a session file fails if 'winheight' is big
Christian Brabandt <cb@256bit.org>
parents: 13435
diff changeset
125 source Xtest_mks_winheight.out
be8fb2fd51fc patch 8.1.0046: loading a session file fails if 'winheight' is big
Christian Brabandt <cb@256bit.org>
parents: 13435
diff changeset
126 call delete('Xtest_mks_winheight.out')
be8fb2fd51fc patch 8.1.0046: loading a session file fails if 'winheight' is big
Christian Brabandt <cb@256bit.org>
parents: 13435
diff changeset
127 endfunc
be8fb2fd51fc patch 8.1.0046: loading a session file fails if 'winheight' is big
Christian Brabandt <cb@256bit.org>
parents: 13435
diff changeset
128
10809
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
129 func Test_mksession_arglist()
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
130 argdel *
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
131 next file1 file2 file3 file4
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
132 mksession! Xtest_mks.out
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
133 source Xtest_mks.out
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
134 call assert_equal(['file1', 'file2', 'file3', 'file4'], argv())
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
135
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
136 call delete('Xtest_mks.out')
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
137 argdel *
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
138 endfunc
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
139
12289
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
140 func Test_mksession_one_buffer_two_windows()
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
141 edit Xtest1
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
142 new Xtest2
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
143 split
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
144 mksession! Xtest_mks.out
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
145 let lines = readfile('Xtest_mks.out')
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
146 let count1 = 0
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
147 let count2 = 0
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
148 let count2buf = 0
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
149 for line in lines
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
150 if line =~ 'edit \f*Xtest1$'
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
151 let count1 += 1
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
152 endif
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
153 if line =~ 'edit \f\{-}Xtest2'
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
154 let count2 += 1
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
155 endif
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
156 if line =~ 'buffer \f\{-}Xtest2'
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
157 let count2buf += 1
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
158 endif
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
159 endfor
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
160 call assert_equal(1, count1, 'Xtest1 count')
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
161 call assert_equal(2, count2, 'Xtest2 count')
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
162 call assert_equal(2, count2buf, 'Xtest2 buffer count')
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
163
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
164 close
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
165 bwipe!
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
166 call delete('Xtest_mks.out')
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
167 endfunc
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
168
14266
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
169 func Test_mksession_lcd_multiple_tabs()
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
170 tabnew
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
171 tabnew
14270
5ad78e7f5b01 patch 8.1.0151: mksession test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14266
diff changeset
172 lcd .
14266
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
173 tabfirst
14270
5ad78e7f5b01 patch 8.1.0151: mksession test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14266
diff changeset
174 lcd .
14266
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
175 mksession! Xtest_mks.out
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
176 tabonly
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
177 source Xtest_mks.out
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
178 call assert_true(haslocaldir(), 'Tab 1 localdir')
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
179 tabnext 2
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
180 call assert_true(!haslocaldir(), 'Tab 2 localdir')
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
181 tabnext 3
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
182 call assert_true(haslocaldir(), 'Tab 3 localdir')
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
183 call delete('Xtest_mks.out')
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
184 endfunc
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
185
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
186 func Test_mksession_blank_tabs()
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
187 tabnew
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
188 tabnew
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
189 tabnew
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
190 tabnext 3
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
191 mksession! Xtest_mks.out
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
192 tabnew
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
193 tabnew
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
194 tabnext 2
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
195 source Xtest_mks.out
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
196 call assert_equal(4, tabpagenr('$'), 'session restore should restore number of tabs')
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
197 call assert_equal(3, tabpagenr(), 'session restore should restore the active tab')
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
198 call delete('Xtest_mks.out')
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
199 endfunc
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
200
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
201 func Test_mksession_blank_windows()
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
202 split
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
203 split
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
204 split
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
205 3 wincmd w
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
206 mksession! Xtest_mks.out
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
207 split
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
208 split
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
209 2 wincmd w
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
210 source Xtest_mks.out
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
211 call assert_equal(4, winnr('$'), 'session restore should restore number of windows')
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
212 call assert_equal(3, winnr(), 'session restore should restore the active window')
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
213 call delete('Xtest_mks.out')
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
214 endfunc
7346b2ea80d8 patch 8.1.0149: session is wrong with multiple tabs when :lcd was used
Christian Brabandt <cb@256bit.org>
parents: 14057
diff changeset
215
13435
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
216 if has('terminal')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
217
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
218 func Test_mksession_terminal_shell()
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
219 terminal
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
220 mksession! Xtest_mks.out
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
221 let lines = readfile('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
222 let term_cmd = ''
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
223 for line in lines
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
224 if line =~ '^terminal'
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
225 let term_cmd = line
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
226 elseif line =~ 'badd.*' . &shell
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
227 call assert_report('unexpected shell line: ' . line)
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
228 endif
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
229 endfor
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
230 call assert_match('terminal ++curwin ++cols=\d\+ ++rows=\d\+\s*$', term_cmd)
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
231
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
232 call Stop_shell_in_terminal(bufnr('%'))
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
233 call delete('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
234 endfunc
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
235
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
236 func Test_mksession_terminal_no_restore_cmdarg()
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
237 terminal ++norestore
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
238 mksession! Xtest_mks.out
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
239 let lines = readfile('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
240 let term_cmd = ''
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
241 for line in lines
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
242 if line =~ '^terminal'
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
243 call assert_report('session must not restore teminal')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
244 endif
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
245 endfor
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
246
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
247 call Stop_shell_in_terminal(bufnr('%'))
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
248 call delete('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
249 endfunc
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
250
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
251 func Test_mksession_terminal_no_restore_funcarg()
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
252 call term_start(&shell, {'norestore': 1})
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
253 mksession! Xtest_mks.out
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
254 let lines = readfile('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
255 let term_cmd = ''
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
256 for line in lines
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
257 if line =~ '^terminal'
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
258 call assert_report('session must not restore teminal')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
259 endif
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
260 endfor
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
261
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
262 call Stop_shell_in_terminal(bufnr('%'))
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
263 call delete('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
264 endfunc
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
265
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
266 func Test_mksession_terminal_no_restore_func()
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
267 terminal
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
268 call term_setrestore(bufnr('%'), 'NONE')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
269 mksession! Xtest_mks.out
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
270 let lines = readfile('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
271 let term_cmd = ''
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
272 for line in lines
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
273 if line =~ '^terminal'
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
274 call assert_report('session must not restore teminal')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
275 endif
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
276 endfor
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
277
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
278 call Stop_shell_in_terminal(bufnr('%'))
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
279 call delete('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
280 endfunc
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
281
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
282 func Test_mksession_terminal_no_ssop()
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
283 terminal
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
284 set sessionoptions-=terminal
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
285 mksession! Xtest_mks.out
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
286 let lines = readfile('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
287 let term_cmd = ''
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
288 for line in lines
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
289 if line =~ '^terminal'
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
290 call assert_report('session must not restore teminal')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
291 endif
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
292 endfor
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
293
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
294 call Stop_shell_in_terminal(bufnr('%'))
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
295 call delete('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
296 set sessionoptions&
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
297 endfunc
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
298
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
299 func Test_mksession_terminal_restore_other()
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
300 terminal
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
301 call term_setrestore(bufnr('%'), 'other')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
302 mksession! Xtest_mks.out
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
303 let lines = readfile('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
304 let term_cmd = ''
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
305 for line in lines
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
306 if line =~ '^terminal'
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
307 let term_cmd = line
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
308 endif
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
309 endfor
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
310 call assert_match('terminal ++curwin ++cols=\d\+ ++rows=\d\+ other', term_cmd)
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
311
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
312 call Stop_shell_in_terminal(bufnr('%'))
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
313 call delete('Xtest_mks.out')
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
314 endfunc
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
315
fa198b71bab2 patch 8.0.1592: terminal windows in a session are not properly restored
Christian Brabandt <cb@256bit.org>
parents: 12291
diff changeset
316 endif " has('terminal')
12289
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
317
14635
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
318 " Test :mkview with a file argument.
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
319 func Test_mkview_file()
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
320 " Create a view with line number and a fold.
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
321 help :mkview
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
322 set number
14644
3d94bbf54530 patch 8.1.0335: mkview test fails on CI
Christian Brabandt <cb@256bit.org>
parents: 14640
diff changeset
323 norm! V}zf0
14646
aa48ee3d3d12 patch 8.1.0336: mkview test still fails on CI
Christian Brabandt <cb@256bit.org>
parents: 14644
diff changeset
324 let pos = getpos('.')
14635
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
325 let linefoldclosed1 = foldclosed('.')
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
326 mkview! Xview
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
327 set nonumber
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
328 norm! zrj
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
329 " We can close the help window, as mkview with a file name should
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
330 " generate a command to edit the file.
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
331 helpclose
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
332
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
333 source Xview
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
334 call assert_equal(1, &number)
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
335 call assert_match('\*:mkview\*$', getline('.'))
14646
aa48ee3d3d12 patch 8.1.0336: mkview test still fails on CI
Christian Brabandt <cb@256bit.org>
parents: 14644
diff changeset
336 call assert_equal(pos, getpos('.'))
14635
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
337 call assert_equal(linefoldclosed1, foldclosed('.'))
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
338
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
339 " Creating a view again with the same file name should fail (file
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
340 " already exists). But with a !, the previous view should be
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
341 " overwritten without error.
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
342 help :loadview
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
343 call assert_fails('mkview Xview', 'E189:')
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
344 call assert_match('\*:loadview\*$', getline('.'))
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
345 mkview! Xview
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
346 call assert_match('\*:loadview\*$', getline('.'))
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
347
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
348 call delete('Xview')
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
349 bwipe
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
350 endfunc
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
351
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
352 " Test :mkview and :loadview with a custom 'viewdir'.
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
353 func Test_mkview_loadview_with_viewdir()
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
354 set viewdir=Xviewdir
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
355
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
356 help :mkview
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
357 set number
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
358 norm! V}zf
14646
aa48ee3d3d12 patch 8.1.0336: mkview test still fails on CI
Christian Brabandt <cb@256bit.org>
parents: 14644
diff changeset
359 let pos = getpos('.')
14635
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
360 let linefoldclosed1 = foldclosed('.')
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
361 mkview 1
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
362 set nonumber
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
363 norm! zrj
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
364
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
365 loadview 1
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
366
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
367 " The directory Xviewdir/ should have been created and the view
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
368 " should be stored in that directory.
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
369 call assert_equal('Xviewdir/' .
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
370 \ substitute(
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
371 \ substitute(
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
372 \ expand('%:p'), '/', '=+', 'g'), ':', '=-', 'g') . '=1.vim',
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
373 \ glob('Xviewdir/*'))
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
374 call assert_equal(1, &number)
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
375 call assert_match('\*:mkview\*$', getline('.'))
14646
aa48ee3d3d12 patch 8.1.0336: mkview test still fails on CI
Christian Brabandt <cb@256bit.org>
parents: 14644
diff changeset
376 call assert_equal(pos, getpos('.'))
14635
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
377 call assert_equal(linefoldclosed1, foldclosed('.'))
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
378
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
379 call delete('Xviewdir', 'rf')
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
380 set viewdir&
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
381 helpclose
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
382 endfunc
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
383
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
384 func Test_mkview_no_file_name()
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
385 new
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
386 " :mkview or :mkview {nr} should fail in a unnamed buffer.
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
387 call assert_fails('mkview', 'E32:')
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
388 call assert_fails('mkview 1', 'E32:')
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
389
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
390 " :mkview {file} should succeed in a unnamed buffer.
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
391 mkview Xview
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
392 help
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
393 source Xview
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
394 call assert_equal('', bufname('%'))
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
395
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
396 call delete('Xview')
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
397 %bwipe
4f61eb88127c patch 8.1.0331: insufficient test coverage for :mkview and :loadview
Christian Brabandt <cb@256bit.org>
parents: 14270
diff changeset
398 endfunc
10809
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
399
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
400 " vim: shiftwidth=2 sts=2 expandtab