Mercurial > vim
comparison src/testdir/test_conceal.vim @ 16720:9c90cf08cfa8 v8.1.1362
patch 8.1.1362: code and data in tests can be hard to read
commit https://github.com/vim/vim/commit/c79745a82faeb5a6058e915ca49a4c69fa60ea01
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 20 22:12:34 2019 +0200
patch 8.1.1362: code and data in tests can be hard to read
Problem: Code and data in tests can be hard to read.
Solution: Use the new heredoc style. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4400)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 20 May 2019 22:15:06 +0200 |
parents | 5b0f37d844b3 |
children | ba7727889385 |
comparison
equal
deleted
inserted
replaced
16719:27f2a2799604 | 16720:9c90cf08cfa8 |
---|---|
9 if !CanRunVimInTerminal() | 9 if !CanRunVimInTerminal() |
10 finish | 10 finish |
11 endif | 11 endif |
12 | 12 |
13 func Test_conceal_two_windows() | 13 func Test_conceal_two_windows() |
14 call writefile([ | 14 let code =<< trim [CODE] |
15 \ 'let lines = ["one one one one one", "two |hidden| here", "three |hidden| three"]', | 15 let lines = ["one one one one one", "two |hidden| here", "three |hidden| three"] |
16 \ 'call setline(1, lines)', | 16 call setline(1, lines) |
17 \ 'syntax match test /|hidden|/ conceal', | 17 syntax match test /|hidden|/ conceal |
18 \ 'set conceallevel=2', | 18 set conceallevel=2 |
19 \ 'set concealcursor=', | 19 set concealcursor= |
20 \ 'exe "normal /here\r"', | 20 exe "normal /here\r" |
21 \ 'new', | 21 new |
22 \ 'call setline(1, lines)', | 22 call setline(1, lines) |
23 \ 'call setline(4, "Second window")', | 23 call setline(4, "Second window") |
24 \ 'syntax match test /|hidden|/ conceal', | 24 syntax match test /|hidden|/ conceal |
25 \ 'set conceallevel=2', | 25 set conceallevel=2 |
26 \ 'set concealcursor=nc', | 26 set concealcursor=nc |
27 \ 'exe "normal /here\r"', | 27 exe "normal /here\r" |
28 \ ], 'XTest_conceal') | 28 [CODE] |
29 | |
30 call writefile(code, 'XTest_conceal') | |
29 " Check that cursor line is concealed | 31 " Check that cursor line is concealed |
30 let buf = RunVimInTerminal('-S XTest_conceal', {}) | 32 let buf = RunVimInTerminal('-S XTest_conceal', {}) |
31 call VerifyScreenDump(buf, 'Test_conceal_two_windows_01', {}) | 33 call VerifyScreenDump(buf, 'Test_conceal_two_windows_01', {}) |
32 | 34 |
33 " Check that with concealed text vertical cursor movement is correct. | 35 " Check that with concealed text vertical cursor movement is correct. |
111 endfunc | 113 endfunc |
112 | 114 |
113 func Test_conceal_with_cursorline() | 115 func Test_conceal_with_cursorline() |
114 " Opens a help window, where 'conceal' is set, switches to the other window | 116 " Opens a help window, where 'conceal' is set, switches to the other window |
115 " where 'cursorline' needs to be updated when the cursor moves. | 117 " where 'cursorline' needs to be updated when the cursor moves. |
116 call writefile([ | 118 let code =<< trim [CODE] |
117 \ 'set cursorline', | 119 set cursorline |
118 \ 'normal othis is a test', | 120 normal othis is a test |
119 \ 'new', | 121 new |
120 \ 'call setline(1, ["one", "two", "three", "four", "five"])', | 122 call setline(1, ["one", "two", "three", "four", "five"]) |
121 \ 'set ft=help', | 123 set ft=help |
122 \ 'normal M', | 124 normal M |
123 \ ], 'XTest_conceal_cul') | 125 [CODE] |
126 | |
127 call writefile(code, 'XTest_conceal_cul') | |
124 let buf = RunVimInTerminal('-S XTest_conceal_cul', {}) | 128 let buf = RunVimInTerminal('-S XTest_conceal_cul', {}) |
125 call VerifyScreenDump(buf, 'Test_conceal_cul_01', {}) | 129 call VerifyScreenDump(buf, 'Test_conceal_cul_01', {}) |
126 | 130 |
127 call term_sendkeys(buf, ":wincmd w\r") | 131 call term_sendkeys(buf, ":wincmd w\r") |
128 call VerifyScreenDump(buf, 'Test_conceal_cul_02', {}) | 132 call VerifyScreenDump(buf, 'Test_conceal_cul_02', {}) |