diff 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
line wrap: on
line diff
--- 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', {})