|
536 | 536 | XX |
537 | 537 | call assert_equal(['Line1'], var1) |
538 | 538 |
|
| 539 | + let var1 =<< trim XX " comment |
| 540 | + Line1 |
| 541 | + Line2 |
| 542 | + Line3 |
| 543 | + XX |
| 544 | + call assert_equal(['Line1', ' Line2', 'Line3'], var1) |
| 545 | + |
539 | 546 | " ignore "endfunc" |
540 | 547 | let var1 =<< END |
541 | 548 | something |
@@ -716,15 +723,27 @@ END |
716 | 723 | call v9.CheckScriptFailure(lines, 'E15:') |
717 | 724 |
|
718 | 725 | " Test for using heredoc in a single string using execute() |
719 | | - call assert_equal(["['one', 'two']"], |
720 | | - \ execute("let x =<< trim END\n one\n two\nEND\necho x")->split("\n")) |
721 | | - call assert_equal(["[' one', ' two']"], |
722 | | - \ execute("let x =<< END\n one\n two\nEND\necho x")->split("\n")) |
| 726 | + call assert_equal("\n['one', 'two']", |
| 727 | + \ execute("let x =<< trim END\n one\n two\nEND\necho x")) |
| 728 | + call assert_equal("\n['one', ' two']", |
| 729 | + \ execute("let x =<< trim END\n one\n two\nEND\necho x")) |
| 730 | + call assert_equal("\n['one', 'two']", |
| 731 | + \ execute(" let x =<< trim END\n one\n two\n END\necho x")) |
| 732 | + call assert_equal("\n['one', ' two']", |
| 733 | + \ execute(" let x =<< trim END\n one\n two\n END\necho x")) |
| 734 | + call assert_equal("\n[' one', ' two']", |
| 735 | + \ execute("let x =<< END\n one\n two\nEND\necho x")) |
| 736 | + call assert_equal("\n['one', 'two']", |
| 737 | + \ execute("let x =<< END\none\ntwo\nEND\necho x")) |
| 738 | + call assert_equal("\n['one', 'two']", |
| 739 | + \ execute("let x =<< END \" comment\none\ntwo\nEND\necho x")) |
723 | 740 | let cmd = 'execute("let x =<< END\n one\n two\necho x")' |
724 | 741 | call assert_fails(cmd, "E990: Missing end marker 'END'") |
725 | 742 | let cmd = 'execute("let x =<<\n one\n two\necho x")' |
726 | | - call assert_fails(cmd, "E990: Missing end marker ''") |
| 743 | + call assert_fails(cmd, "E172: Missing marker") |
727 | 744 | let cmd = 'execute("let x =<< trim\n one\n two\necho x")' |
| 745 | + call assert_fails(cmd, "E172: Missing marker") |
| 746 | + let cmd = 'execute("let x =<< end\n one\n two\nend\necho x")' |
728 | 747 | call assert_fails(cmd, "E221: Marker cannot start with lower case letter") |
729 | 748 | let cmd = 'execute("let x =<< eval END\n one\n two{y}\nEND\necho x")' |
730 | 749 | call assert_fails(cmd, 'E121: Undefined variable: y') |
|
0 commit comments