diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2024-04-13 05:55:51 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2024-04-14 05:03:31 +0800 |
| commit | 617a3851426434bc22d82fe7574ba8f0455c0dcd (patch) | |
| tree | 08d2c80e7fe55c7fe382048c3862580a8aad53ca /test | |
| parent | b87212e66962c2738bbe763e85b450be5e6b2090 (diff) | |
| download | rneovim-617a3851426434bc22d82fe7574ba8f0455c0dcd.tar.gz rneovim-617a3851426434bc22d82fe7574ba8f0455c0dcd.tar.bz2 rneovim-617a3851426434bc22d82fe7574ba8f0455c0dcd.zip | |
vim-patch:9.1.0312: heredocs are not supported for :commands
Problem: heredocs are not supported for :commands
(balki)
Solution: Add heredoc support
(Yegappan Lakshmanan)
fixes: vim/vim#14491
closes: vim/vim#14528
https://github.com/vim/vim/commit/e74cad3321ce1dcefc1fc64f617511275b6cd930
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'test')
| -rw-r--r-- | test/old/testdir/test_let.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/old/testdir/test_let.vim b/test/old/testdir/test_let.vim index 655c177385..56b880f3b0 100644 --- a/test/old/testdir/test_let.vim +++ b/test/old/testdir/test_let.vim @@ -713,6 +713,20 @@ END LINES call CheckScriptFailure(lines, 'E15:') + " Test for using heredoc in a single string using execute() + call assert_equal(["['one', 'two']"], + \ execute("let x =<< trim END\n one\n two\nEND\necho x")->split("\n")) + call assert_equal(["[' one', ' two']"], + \ execute("let x =<< END\n one\n two\nEND\necho x")->split("\n")) + let cmd = 'execute("let x =<< END\n one\n two\necho x")' + call assert_fails(cmd, "E990: Missing end marker 'END'") + let cmd = 'execute("let x =<<\n one\n two\necho x")' + call assert_fails(cmd, "E990: Missing end marker ''") + let cmd = 'execute("let x =<< trim\n one\n two\necho x")' + call assert_fails(cmd, "E221: Marker cannot start with lower case letter") + let cmd = 'execute("let x =<< eval END\n one\n two{y}\nEND\necho x")' + call assert_fails(cmd, 'E121: Undefined variable: y') + " skipped heredoc if 0 let msg =<< trim eval END |