annotate src/testdir/test_mksession_utf8.vim @ 19783:546bdeef35f1 v8.2.0448

patch 8.2.0448: various functions not properly tested Commit: https://github.com/vim/vim/commit/0e05de46226eb4e5ea580beefa71831f92d613d3 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 25 22:23:46 2020 +0100 patch 8.2.0448: various functions not properly tested Problem: Various functions not properly tested. Solution: Add more tests, especially for failures. (Yegappan Lakshmanan, closes #5843)
author Bram Moolenaar <Bram@vim.org>
date Wed, 25 Mar 2020 22:30:04 +0100
parents 6990c1160ea5
children
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 utf-8 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=utf-8
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 scriptencoding utf-8
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
17089
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents: 17049
diff changeset
6 source check.vim
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents: 17049
diff changeset
7 CheckFeature mksession
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 func Test_mksession_utf8()
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 tabnew
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 let wrap_save = &wrap
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 set sessionoptions=buffers splitbelow fileencoding=utf-8
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 call setline(1, [
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 \ 'start:',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 \ 'no multibyte chAracter',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 \ ' one leaDing tab',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 \ ' four leadinG spaces',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 \ 'two consecutive tabs',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 \ 'two tabs in one line',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 \ 'one … multibyteCharacter',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ 'a “b” two multiByte characters',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ '“c”1€ three mulTibyte characters'
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 \ ])
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 let tmpfile = tempname()
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 exec 'w! ' . tmpfile
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 /^start:
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 set wrap
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 vsplit
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 split
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! j8|
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! j8|
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! j16|
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! j16|
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 wincmd l
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 set nowrap
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 /^start:
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 norm! j16|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 norm! j08|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! j08|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! j016|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! j016|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 call wincol()
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 mksession! test_mks.out
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 let li = filter(readfile('test_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"')
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
67 let expected =<< trim [DATA]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
68 normal! 016|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
69 normal! 016|
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
70 normal! 016|
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
71 normal! 08|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
72 normal! 08|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
73 normal! 016|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
74 normal! 016|
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
75 normal! 016|
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
76 exe 'normal! ' . s:c . '|zs' . 16 . '|'
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
77 normal! 016|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
78 exe 'normal! ' . s:c . '|zs' . 16 . '|'
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
79 normal! 016|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
80 exe 'normal! ' . s:c . '|zs' . 16 . '|'
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
81 normal! 016|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
82 exe 'normal! ' . s:c . '|zs' . 8 . '|'
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
83 normal! 08|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
84 exe 'normal! ' . s:c . '|zs' . 8 . '|'
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
85 normal! 08|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
86 exe 'normal! ' . s:c . '|zs' . 16 . '|'
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
87 normal! 016|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
88 exe 'normal! ' . s:c . '|zs' . 16 . '|'
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
89 normal! 016|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
90 exe 'normal! ' . s:c . '|zs' . 16 . '|'
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
91 normal! 016|
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
92 exe 'normal! ' . s:c . '|zs' . 16 . '|'
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
93 normal! 016|
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
94 [DATA]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
95
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 call assert_equal(expected, li)
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 tabclose!
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99 call delete('test_mks.out')
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 call delete(tmpfile)
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 let &wrap = wrap_save
12914
32c51eef574e patch 8.0.1333: some tests are run twice
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
102 set sessionoptions& splitbelow& fileencoding&
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 endfunc
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105 " vim: shiftwidth=2 sts=2 expandtab