Mercurial > vim
comparison src/testdir/test_let.vim @ 17462:9088fafff9b3 v8.1.1729
patch 8.1.1729: heredoc with trim not properly handled in function
commit https://github.com/vim/vim/commit/ecaa75b4cea329a3902b8565e028b32279b8322b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 21 23:04:21 2019 +0200
patch 8.1.1729: heredoc with trim not properly handled in function
Problem: Heredoc with trim not properly handled in function.
Solution: Allow for missing indent. (FUJIWARA Takuya, closes https://github.com/vim/vim/issues/4713)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 21 Jul 2019 23:15:05 +0200 |
parents | 509542f1fffb |
children | 9ea364ccf216 |
comparison
equal
deleted
inserted
replaced
17461:1fc9ec9b71a0 | 17462:9088fafff9b3 |
---|---|
186 call writefile(text, 'XheredocBadMarker') | 186 call writefile(text, 'XheredocBadMarker') |
187 call assert_fails('source XheredocBadMarker', 'E221:') | 187 call assert_fails('source XheredocBadMarker', 'E221:') |
188 call delete('XheredocBadMarker') | 188 call delete('XheredocBadMarker') |
189 endfunc | 189 endfunc |
190 | 190 |
191 func Test_let_heredoc_trim_no_indent_marker() | |
192 let text =<< trim END | |
193 Text | |
194 with | |
195 indent | |
196 END | |
197 call assert_equal(['Text', 'with', 'indent'], text) | |
198 endfunc | |
199 | |
191 " Test for the setting a variable using the heredoc syntax | 200 " Test for the setting a variable using the heredoc syntax |
192 func Test_let_heredoc() | 201 func Test_let_heredoc() |
193 let var1 =<< END | 202 let var1 =<< END |
194 Some sample text | 203 Some sample text |
195 Text with indent | 204 Text with indent |