@@ -445,6 +445,48 @@ EOF same-line-arg
445
445
expectErr : true ,
446
446
errorMessage : "mismatched leading whitespace in heredoc <<EOF on line #2 [ content], expected whitespace [\t \t ] to match the closing marker" ,
447
447
},
448
+ {
449
+ input : []byte (`heredoc <<EOF
450
+ The next line is a blank line
451
+
452
+ The previous line is a blank line
453
+ EOF` ),
454
+ expected : []Token {
455
+ {Line : 1 , Text : "heredoc" },
456
+ {Line : 1 , Text : "The next line is a blank line\n \n The previous line is a blank line" },
457
+ },
458
+ },
459
+ {
460
+ input : []byte (`heredoc <<EOF
461
+ One tab indented heredoc with blank next line
462
+
463
+ One tab indented heredoc with blank previous line
464
+ EOF` ),
465
+ expected : []Token {
466
+ {Line : 1 , Text : "heredoc" },
467
+ {Line : 1 , Text : "One tab indented heredoc with blank next line\n \n One tab indented heredoc with blank previous line" },
468
+ },
469
+ },
470
+ {
471
+ input : []byte (`heredoc <<EOF
472
+ The next line is a blank line with one tab
473
+
474
+ The previous line is a blank line with one tab
475
+ EOF` ),
476
+ expected : []Token {
477
+ {Line : 1 , Text : "heredoc" },
478
+ {Line : 1 , Text : "The next line is a blank line with one tab\n \t \n The previous line is a blank line with one tab" },
479
+ },
480
+ },
481
+ {
482
+ input : []byte (`heredoc <<EOF
483
+ The next line is a blank line with one tab less than the correct indentation
484
+
485
+ The previous line is a blank line with one tab less than the correct indentation
486
+ EOF` ),
487
+ expectErr : true ,
488
+ errorMessage : "mismatched leading whitespace in heredoc <<EOF on line #3 [\t ], expected whitespace [\t \t ] to match the closing marker" ,
489
+ },
448
490
}
449
491
450
492
for i , testCase := range testCases {
0 commit comments