summaryrefslogtreecommitdiff
path: root/src/testdir/test_conceal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-20 22:12:34 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-20 22:12:34 +0200
commitc79745a82faeb5a6058e915ca49a4c69fa60ea01 (patch)
treebe7dc4ecffe429763159bfef2f95c06ea7fb8b67 /src/testdir/test_conceal.vim
parent0b0ad35c339b8ad156df493bebeb77e02b32b120 (diff)
downloadvim-git-c79745a82faeb5a6058e915ca49a4c69fa60ea01.tar.gz
patch 8.1.1362: code and data in tests can be hard to readv8.1.1362
Problem: Code and data in tests can be hard to read. Solution: Use the new heredoc style. (Yegappan Lakshmanan, closes #4400)
Diffstat (limited to 'src/testdir/test_conceal.vim')
-rw-r--r--src/testdir/test_conceal.vim50
1 files changed, 27 insertions, 23 deletions
diff --git a/src/testdir/test_conceal.vim b/src/testdir/test_conceal.vim
index 685c89175..66384e1c1 100644
--- a/src/testdir/test_conceal.vim
+++ b/src/testdir/test_conceal.vim
@@ -11,21 +11,23 @@ if !CanRunVimInTerminal()
endif
func Test_conceal_two_windows()
- call writefile([
- \ 'let lines = ["one one one one one", "two |hidden| here", "three |hidden| three"]',
- \ 'call setline(1, lines)',
- \ 'syntax match test /|hidden|/ conceal',
- \ 'set conceallevel=2',
- \ 'set concealcursor=',
- \ 'exe "normal /here\r"',
- \ 'new',
- \ 'call setline(1, lines)',
- \ 'call setline(4, "Second window")',
- \ 'syntax match test /|hidden|/ conceal',
- \ 'set conceallevel=2',
- \ 'set concealcursor=nc',
- \ 'exe "normal /here\r"',
- \ ], 'XTest_conceal')
+ let code =<< trim [CODE]
+ let lines = ["one one one one one", "two |hidden| here", "three |hidden| three"]
+ call setline(1, lines)
+ syntax match test /|hidden|/ conceal
+ set conceallevel=2
+ set concealcursor=
+ exe "normal /here\r"
+ new
+ call setline(1, lines)
+ call setline(4, "Second window")
+ syntax match test /|hidden|/ conceal
+ set conceallevel=2
+ set concealcursor=nc
+ exe "normal /here\r"
+ [CODE]
+
+ call writefile(code, 'XTest_conceal')
" Check that cursor line is concealed
let buf = RunVimInTerminal('-S XTest_conceal', {})
call VerifyScreenDump(buf, 'Test_conceal_two_windows_01', {})
@@ -113,14 +115,16 @@ endfunc
func Test_conceal_with_cursorline()
" Opens a help window, where 'conceal' is set, switches to the other window
" where 'cursorline' needs to be updated when the cursor moves.
- call writefile([
- \ 'set cursorline',
- \ 'normal othis is a test',
- \ 'new',
- \ 'call setline(1, ["one", "two", "three", "four", "five"])',
- \ 'set ft=help',
- \ 'normal M',
- \ ], 'XTest_conceal_cul')
+ let code =<< trim [CODE]
+ set cursorline
+ normal othis is a test
+ new
+ call setline(1, ["one", "two", "three", "four", "five"])
+ set ft=help
+ normal M
+ [CODE]
+
+ call writefile(code, 'XTest_conceal_cul')
let buf = RunVimInTerminal('-S XTest_conceal_cul', {})
call VerifyScreenDump(buf, 'Test_conceal_cul_01', {})