specsuite: tests for flush heredocs with empty lines

This commit is contained in:
Aaron Gallagher 2019-08-06 00:24:22 +01:00 committed by Martin Atkins
parent 0c3fe388e4
commit 65731f3310
3 changed files with 62 additions and 0 deletions

View File

@ -1269,6 +1269,36 @@ EOT
cty.TupleVal([]cty.Value{cty.StringVal(" Foo\n Bar\n Baz\n")}),
0,
},
{
`[
<<EOT
Foo
Bar
Baz
EOT
]
`,
nil,
cty.TupleVal([]cty.Value{cty.StringVal(" Foo\n\n Bar\n\n Baz\n")}),
0,
},
{
`[
<<-EOT
Foo
Bar
Baz
EOT
]
`,
nil,
cty.TupleVal([]cty.Value{cty.StringVal("Foo\n\nBar\n\nBaz\n")}),
0,
},
{
`unk["baz"]`,

View File

@ -19,6 +19,20 @@ EOT
${bar}
Baz
EOT
newlines_between = <<EOT
Foo
Bar
Baz
EOT
indented_newlines_between = <<EOT
Foo
Bar
Baz
EOT
marker_at_suffix = <<EOT
NOT EOT
@ -70,4 +84,18 @@ EOT
Bar
Baz
EOT
newlines_between = <<-EOT
Foo
Bar
Baz
EOT
indented_newlines_between = <<-EOT
Foo
Bar
Baz
EOT
}

View File

@ -4,6 +4,8 @@ result = {
indented = " Foo\n Bar\n Baz\n"
indented_more = " Foo\n Bar\n Baz\n"
interp = " Foo\n Bar\n Baz\n"
newlines_between = "Foo\n\nBar\n\nBaz\n"
indented_newlines_between = " Foo\n\n Bar\n\n Baz\n"
marker_at_suffix = " NOT EOT\n"
}
@ -17,6 +19,8 @@ result = {
interp_indented_less = " Foo\n Bar\n Baz\n"
tabs = "Foo\n Bar\n Baz\n"
unicode_spaces = "Foo (there's two \"em spaces\" before Foo there)\nBar\nBaz\n"
newlines_between = "Foo\n\nBar\n\nBaz\n"
indented_newlines_between = "Foo\n\nBar\n\nBaz\n"
}
}
result_type = object({