Skip to content

Commit 4f1e224

Browse files
committed
add more cases to heredoc test
1 parent e6edd84 commit 4f1e224

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

test/test_heredoc.ok

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
(let =<< a (heredoc (list) "EOS" (list "hello" " world")))
22
(let =<< a (heredoc (list "trim") "EOS" (list "\thello" "world")))
33
(let =<< a (heredoc (list) "EOS" (list)))
4+
(if v:true
5+
; matching leading indentation is accepted
6+
(let =<< a (heredoc (list "trim") "EOS" (list "\t\thello" "\tworld")))
7+
(let =<< a (heredoc (list "trim") "EOS" (list " hello" " world")))
8+
; but isn't required
9+
(let =<< a (heredoc (list "trim") "EOS" (list " hello" " world"))))
10+
; we don't actually do the trimming for trim heredocs
11+
(let =<< a (heredoc (list "trim") "EOS" (list " hello" " world")))

test/test_heredoc.vim

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,24 @@ world
88
EOS
99
let a =<< EOS
1010
EOS
11+
if v:true
12+
" matching leading indentation is accepted
13+
let a =<< trim EOS
14+
hello
15+
world
16+
EOS
17+
let a =<< trim EOS
18+
hello
19+
world
20+
EOS
21+
" but isn't required
22+
let a =<< trim EOS
23+
hello
24+
world
25+
EOS
26+
endif
27+
" we don't actually do the trimming for trim heredocs
28+
let a =<< trim EOS
29+
hello
30+
world
31+
EOS

0 commit comments

Comments
 (0)