From aed824cf555185b3535e77c199ed541035349ee3 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 10 Nov 2015 15:08:59 -0800 Subject: [PATCH] add more heredoc tests --- decoder_test.go | 15 +++++++++++++++ test-fixtures/multiline.hcl | 4 ++++ test-fixtures/multiline_bad.hcl | 2 +- test-fixtures/multiline_no_eof.hcl | 5 +++++ test-fixtures/multiline_no_marker.hcl | 1 + 5 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test-fixtures/multiline.hcl create mode 100644 test-fixtures/multiline_no_eof.hcl create mode 100644 test-fixtures/multiline_no_marker.hcl diff --git a/decoder_test.go b/decoder_test.go index de90ec0..ebf7c90 100644 --- a/decoder_test.go +++ b/decoder_test.go @@ -59,9 +59,24 @@ func TestDecode_interface(t *testing.T) { }, { "multiline_bad.hcl", + true, + nil, + }, + { + "multiline_no_marker.hcl", + true, + nil, + }, + { + "multiline.hcl", false, map[string]interface{}{"foo": "bar\nbaz\n"}, }, + { + "multiline_no_eof.hcl", + false, + map[string]interface{}{"foo": "bar\nbaz\n", "key": "value"}, + }, { "multiline.json", false, diff --git a/test-fixtures/multiline.hcl b/test-fixtures/multiline.hcl new file mode 100644 index 0000000..f883bd7 --- /dev/null +++ b/test-fixtures/multiline.hcl @@ -0,0 +1,4 @@ +foo = <