From 6e2cb00008cbf09e556b00f87603797fcaa47e09 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 16 Apr 2018 05:37:14 -0700 Subject: Depenancy upgrades and movign to dep. (#8630) --- .../hashicorp/hcl/.github/ISSUE_TEMPLATE.md | 21 - vendor/github.com/hashicorp/hcl/decoder_test.go | 1203 -------------------- .../github.com/hashicorp/hcl/hcl/ast/ast_test.go | 200 ---- .../github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go | 162 --- .../hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go | 440 ------- .../hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore | 1 - .../hcl/hcl/fmtcmd/test-fixtures/dir.ignore | 0 .../hcl/hcl/fmtcmd/test-fixtures/file.ignore | 1 - .../hcl/hcl/fmtcmd/test-fixtures/good.hcl | 0 .../hashicorp/hcl/hcl/parser/error_test.go | 9 - .../github.com/hashicorp/hcl/hcl/parser/parser.go | 6 + .../hashicorp/hcl/hcl/parser/parser_test.go | 575 ---------- .../hcl/hcl/parser/test-fixtures/array_comment.hcl | 4 - .../hcl/parser/test-fixtures/array_comment_2.hcl | 6 - .../hcl/hcl/parser/test-fixtures/assign_colon.hcl | 6 - .../hcl/hcl/parser/test-fixtures/assign_deep.hcl | 5 - .../hcl/hcl/parser/test-fixtures/comment.hcl | 15 - .../hcl/hcl/parser/test-fixtures/comment_crlf.hcl | 15 - .../hcl/parser/test-fixtures/comment_lastline.hcl | 1 - .../hcl/parser/test-fixtures/comment_single.hcl | 1 - .../hcl/hcl/parser/test-fixtures/complex.hcl | 42 - .../hcl/hcl/parser/test-fixtures/complex_crlf.hcl | 42 - .../hcl/hcl/parser/test-fixtures/complex_key.hcl | 1 - .../hcl/hcl/parser/test-fixtures/empty.hcl | 0 .../hcl/hcl/parser/test-fixtures/git_crypt.hcl | Bin 10 -> 0 bytes .../hcl/parser/test-fixtures/key_without_value.hcl | 1 - .../hcl/hcl/parser/test-fixtures/list.hcl | 1 - .../hcl/hcl/parser/test-fixtures/list_comma.hcl | 1 - .../hcl/parser/test-fixtures/missing_braces.hcl | 4 - .../hcl/hcl/parser/test-fixtures/multiple.hcl | 2 - .../object_key_assign_without_value.hcl | 3 - .../object_key_assign_without_value2.hcl | 4 - .../object_key_assign_without_value3.hcl | 4 - .../test-fixtures/object_key_without_value.hcl | 3 - .../hcl/parser/test-fixtures/object_list_comma.hcl | 1 - .../hashicorp/hcl/hcl/parser/test-fixtures/old.hcl | 3 - .../hcl/hcl/parser/test-fixtures/structure.hcl | 5 - .../hcl/parser/test-fixtures/structure_basic.hcl | 5 - .../hcl/parser/test-fixtures/structure_empty.hcl | 1 - .../hcl/hcl/parser/test-fixtures/types.hcl | 7 - .../parser/test-fixtures/unterminated_object.hcl | 2 - .../parser/test-fixtures/unterminated_object_2.hcl | 6 - .../github.com/hashicorp/hcl/hcl/printer/nodes.go | 190 ++-- .../hashicorp/hcl/hcl/printer/printer_test.go | 149 --- .../hcl/hcl/printer/testdata/comment.golden | 36 - .../hcl/hcl/printer/testdata/comment.input | 37 - .../hcl/printer/testdata/comment_aligned.golden | 32 - .../hcl/hcl/printer/testdata/comment_aligned.input | 28 - .../hcl/hcl/printer/testdata/comment_array.golden | 13 - .../hcl/hcl/printer/testdata/comment_array.input | 13 - .../hcl/hcl/printer/testdata/comment_crlf.input | 37 - .../hcl/printer/testdata/comment_end_file.golden | 6 - .../hcl/printer/testdata/comment_end_file.input | 5 - .../testdata/comment_multiline_indent.golden | 12 - .../testdata/comment_multiline_indent.input | 13 - .../testdata/comment_multiline_no_stanza.golden | 7 - .../testdata/comment_multiline_no_stanza.input | 6 - .../testdata/comment_multiline_stanza.golden | 10 - .../testdata/comment_multiline_stanza.input | 10 - .../hcl/printer/testdata/comment_newline.golden | 3 - .../hcl/hcl/printer/testdata/comment_newline.input | 2 - .../printer/testdata/comment_object_multi.golden | 9 - .../printer/testdata/comment_object_multi.input | 9 - .../hcl/printer/testdata/comment_standalone.golden | 17 - .../hcl/printer/testdata/comment_standalone.input | 16 - .../hcl/hcl/printer/testdata/complexhcl.golden | 54 - .../hcl/hcl/printer/testdata/complexhcl.input | 53 - .../hcl/hcl/printer/testdata/empty_block.golden | 12 - .../hcl/hcl/printer/testdata/empty_block.input | 14 - .../hashicorp/hcl/hcl/printer/testdata/list.golden | 43 - .../hashicorp/hcl/hcl/printer/testdata/list.input | 37 - .../hcl/hcl/printer/testdata/list_comment.golden | 7 - .../hcl/hcl/printer/testdata/list_comment.input | 6 - .../hcl/printer/testdata/list_of_objects.golden | 10 - .../hcl/hcl/printer/testdata/list_of_objects.input | 10 - .../hcl/printer/testdata/multiline_string.golden | 7 - .../hcl/printer/testdata/multiline_string.input | 7 - .../hcl/printer/testdata/object_singleline.golden | 26 - .../hcl/printer/testdata/object_singleline.input | 19 - .../printer/testdata/object_with_heredoc.golden | 6 - .../hcl/printer/testdata/object_with_heredoc.input | 6 - .../hashicorp/hcl/hcl/scanner/scanner.go | 29 +- .../hashicorp/hcl/hcl/scanner/scanner_test.go | 591 ---------- .../hashicorp/hcl/hcl/strconv/quote_test.go | 96 -- .../hcl/hcl/test-fixtures/array_comment.hcl | 4 - .../hcl/hcl/test-fixtures/assign_colon.hcl | 6 - .../hashicorp/hcl/hcl/test-fixtures/comment.hcl | 15 - .../hcl/hcl/test-fixtures/comment_single.hcl | 1 - .../hashicorp/hcl/hcl/test-fixtures/complex.hcl | 42 - .../hcl/hcl/test-fixtures/complex_key.hcl | 1 - .../hashicorp/hcl/hcl/test-fixtures/empty.hcl | 0 .../hashicorp/hcl/hcl/test-fixtures/list.hcl | 1 - .../hashicorp/hcl/hcl/test-fixtures/list_comma.hcl | 1 - .../hashicorp/hcl/hcl/test-fixtures/multiple.hcl | 2 - .../hashicorp/hcl/hcl/test-fixtures/old.hcl | 3 - .../hashicorp/hcl/hcl/test-fixtures/structure.hcl | 5 - .../hcl/hcl/test-fixtures/structure_basic.hcl | 5 - .../hcl/hcl/test-fixtures/structure_empty.hcl | 1 - .../hashicorp/hcl/hcl/test-fixtures/types.hcl | 7 - .../hashicorp/hcl/hcl/token/token_test.go | 69 -- vendor/github.com/hashicorp/hcl/hcl_test.go | 19 - .../hashicorp/hcl/json/parser/parser_test.go | 384 ------- .../hcl/json/parser/test-fixtures/array.json | 4 - .../json/parser/test-fixtures/bad_input_128.json | 1 - .../parser/test-fixtures/bad_input_tf_8110.json | 7 - .../hcl/json/parser/test-fixtures/basic.json | 3 - .../parser/test-fixtures/good_input_tf_8110.json | 7 - .../hcl/json/parser/test-fixtures/object.json | 5 - .../hcl/json/parser/test-fixtures/types.json | 10 - .../hashicorp/hcl/json/scanner/scanner_test.go | 362 ------ .../hashicorp/hcl/json/test-fixtures/array.json | 4 - .../hashicorp/hcl/json/test-fixtures/basic.json | 3 - .../hashicorp/hcl/json/test-fixtures/object.json | 5 - .../hashicorp/hcl/json/test-fixtures/types.json | 10 - .../hashicorp/hcl/json/token/token_test.go | 34 - vendor/github.com/hashicorp/hcl/lex_test.go | 37 - .../hashicorp/hcl/test-fixtures/assign_deep.hcl | 5 - .../hashicorp/hcl/test-fixtures/basic.hcl | 2 - .../hashicorp/hcl/test-fixtures/basic.json | 4 - .../hcl/test-fixtures/basic_int_string.hcl | 1 - .../hashicorp/hcl/test-fixtures/basic_squish.hcl | 3 - .../hashicorp/hcl/test-fixtures/block_assign.hcl | 2 - .../hashicorp/hcl/test-fixtures/decode_policy.hcl | 15 - .../hashicorp/hcl/test-fixtures/decode_policy.json | 19 - .../hcl/test-fixtures/decode_tf_variable.hcl | 10 - .../hcl/test-fixtures/decode_tf_variable.json | 14 - .../hashicorp/hcl/test-fixtures/empty.hcl | 1 - .../hashicorp/hcl/test-fixtures/escape.hcl | 6 - .../hcl/test-fixtures/escape_backslash.hcl | 5 - .../hashicorp/hcl/test-fixtures/flat.hcl | 2 - .../hashicorp/hcl/test-fixtures/float.hcl | 2 - .../hashicorp/hcl/test-fixtures/float.json | 4 - .../hashicorp/hcl/test-fixtures/git_crypt.hcl | Bin 10 -> 0 bytes .../hashicorp/hcl/test-fixtures/interpolate.json | 3 - .../hashicorp/hcl/test-fixtures/list_of_lists.hcl | 2 - .../hashicorp/hcl/test-fixtures/list_of_maps.hcl | 4 - .../hashicorp/hcl/test-fixtures/multiline.hcl | 4 - .../hashicorp/hcl/test-fixtures/multiline.json | 3 - .../hashicorp/hcl/test-fixtures/multiline_bad.hcl | 4 - .../hcl/test-fixtures/multiline_indented.hcl | 4 - .../hcl/test-fixtures/multiline_literal.hcl | 2 - .../test-fixtures/multiline_literal_with_hil.hcl | 2 - .../hcl/test-fixtures/multiline_no_eof.hcl | 5 - .../test-fixtures/multiline_no_hanging_indent.hcl | 5 - .../hcl/test-fixtures/multiline_no_marker.hcl | 1 - .../hcl/test-fixtures/nested_block_comment.hcl | 5 - .../hcl/test-fixtures/nested_provider_bad.hcl | 5 - .../hashicorp/hcl/test-fixtures/null_strings.json | 7 - .../hashicorp/hcl/test-fixtures/object_list.json | 15 - .../hcl/test-fixtures/object_with_bool.hcl | 6 - .../hashicorp/hcl/test-fixtures/scientific.hcl | 6 - .../hashicorp/hcl/test-fixtures/scientific.json | 8 - .../hashicorp/hcl/test-fixtures/slice_expand.hcl | 7 - .../hashicorp/hcl/test-fixtures/structure.hcl | 5 - .../hashicorp/hcl/test-fixtures/structure.json | 8 - .../hashicorp/hcl/test-fixtures/structure2.hcl | 9 - .../hashicorp/hcl/test-fixtures/structure2.json | 10 - .../hcl/test-fixtures/structure_flat.json | 8 - .../hcl/test-fixtures/structure_flatmap.hcl | 7 - .../hashicorp/hcl/test-fixtures/structure_list.hcl | 6 - .../hcl/test-fixtures/structure_list.json | 7 - .../hcl/test-fixtures/structure_list_deep.json | 16 - .../hcl/test-fixtures/structure_list_empty.json | 3 - .../hcl/test-fixtures/structure_multi.hcl | 7 - .../hcl/test-fixtures/structure_multi.json | 11 - .../hcl/test-fixtures/terraform_heroku.hcl | 5 - .../hcl/test-fixtures/terraform_heroku.json | 6 - .../test-fixtures/terraform_variable_invalid.json | 5 - .../hashicorp/hcl/test-fixtures/tfvars.hcl | 3 - .../test-fixtures/unterminated_block_comment.hcl | 2 - .../hcl/test-fixtures/unterminated_brace.hcl | 2 - .../hashicorp/hcl/testhelper/unix2dos.go | 15 - 172 files changed, 121 insertions(+), 5767 deletions(-) delete mode 100644 vendor/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md delete mode 100644 vendor/github.com/hashicorp/hcl/decoder_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/ast/ast_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/dir.ignore delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/good.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/error_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/parser_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment_2.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_colon.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_deep.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_crlf.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_lastline.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_single.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex_crlf.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex_key.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/empty.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/git_crypt.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/key_without_value.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list_comma.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/missing_braces.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/multiple.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_assign_without_value.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_assign_without_value2.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_assign_without_value3.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_without_value.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_list_comma.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/old.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_basic.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_empty.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/types.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/unterminated_object.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/parser/test-fixtures/unterminated_object_2.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.golden delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.input delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/strconv/quote_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/hcl/token/token_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/hcl_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/json/parser/parser_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json delete mode 100644 vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json delete mode 100644 vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json delete mode 100644 vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json delete mode 100644 vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json delete mode 100644 vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json delete mode 100644 vendor/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json delete mode 100644 vendor/github.com/hashicorp/hcl/json/scanner/scanner_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/json/test-fixtures/array.json delete mode 100644 vendor/github.com/hashicorp/hcl/json/test-fixtures/basic.json delete mode 100644 vendor/github.com/hashicorp/hcl/json/test-fixtures/object.json delete mode 100644 vendor/github.com/hashicorp/hcl/json/test-fixtures/types.json delete mode 100644 vendor/github.com/hashicorp/hcl/json/token/token_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/lex_test.go delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/basic.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/basic.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/empty.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/escape.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/flat.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/float.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/float.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/interpolate.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/multiline.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/multiline.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/multiline_bad.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/multiline_indented.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/multiline_literal.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/multiline_literal_with_hil.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/multiline_no_eof.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/multiline_no_hanging_indent.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/multiline_no_marker.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/nested_block_comment.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/nested_provider_bad.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/null_strings.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/object_list.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/object_with_bool.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/scientific.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/scientific.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/slice_expand.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure2.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure2.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure_flat.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure_flatmap.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure_list.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure_list.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure_list_deep.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure_list_empty.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure_multi.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/structure_multi.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/terraform_variable_invalid.json delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/tfvars.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/unterminated_block_comment.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/test-fixtures/unterminated_brace.hcl delete mode 100644 vendor/github.com/hashicorp/hcl/testhelper/unix2dos.go (limited to 'vendor/github.com/hashicorp/hcl') diff --git a/vendor/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md b/vendor/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 2d7fc4bf6..000000000 --- a/vendor/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,21 +0,0 @@ -### HCL Template -```hcl -# Place your HCL configuration file here -``` - -### Expected behavior -What should have happened? - -### Actual behavior -What actually happened? - -### Steps to reproduce -1. -2. -3. - -### References -Are there any other GitHub issues (open or closed) that should -be linked here? For example: -- GH-1234 -- ... diff --git a/vendor/github.com/hashicorp/hcl/decoder_test.go b/vendor/github.com/hashicorp/hcl/decoder_test.go deleted file mode 100644 index 8682f470e..000000000 --- a/vendor/github.com/hashicorp/hcl/decoder_test.go +++ /dev/null @@ -1,1203 +0,0 @@ -package hcl - -import ( - "io/ioutil" - "path/filepath" - "reflect" - "testing" - "time" - - "github.com/davecgh/go-spew/spew" - "github.com/hashicorp/hcl/hcl/ast" -) - -func TestDecode_interface(t *testing.T) { - cases := []struct { - File string - Err bool - Out interface{} - }{ - { - "basic.hcl", - false, - map[string]interface{}{ - "foo": "bar", - "bar": "${file(\"bing/bong.txt\")}", - }, - }, - { - "basic_squish.hcl", - false, - map[string]interface{}{ - "foo": "bar", - "bar": "${file(\"bing/bong.txt\")}", - "foo-bar": "baz", - }, - }, - { - "empty.hcl", - false, - map[string]interface{}{ - "resource": []map[string]interface{}{ - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{}, - }, - }, - }, - }, - }, - { - "tfvars.hcl", - false, - map[string]interface{}{ - "regularvar": "Should work", - "map.key1": "Value", - "map.key2": "Other value", - }, - }, - { - "escape.hcl", - false, - map[string]interface{}{ - "foo": "bar\"baz\\n", - "qux": "back\\slash", - "bar": "new\nline", - "qax": `slash\:colon`, - "nested": `${HH\\:mm\\:ss}`, - "nestedquotes": `${"\"stringwrappedinquotes\""}`, - }, - }, - { - "float.hcl", - false, - map[string]interface{}{ - "a": 1.02, - "b": 2, - }, - }, - { - "multiline_bad.hcl", - true, - nil, - }, - { - "multiline_literal.hcl", - true, - nil, - }, - { - "multiline_literal_with_hil.hcl", - false, - map[string]interface{}{"multiline_literal_with_hil": "${hello\n world}"}, - }, - { - "multiline_no_marker.hcl", - true, - nil, - }, - { - "multiline.hcl", - false, - map[string]interface{}{"foo": "bar\nbaz\n"}, - }, - { - "multiline_indented.hcl", - false, - map[string]interface{}{"foo": " bar\n baz\n"}, - }, - { - "multiline_no_hanging_indent.hcl", - false, - map[string]interface{}{"foo": " baz\n bar\n foo\n"}, - }, - { - "multiline_no_eof.hcl", - false, - map[string]interface{}{"foo": "bar\nbaz\n", "key": "value"}, - }, - { - "multiline.json", - false, - map[string]interface{}{"foo": "bar\nbaz"}, - }, - { - "null_strings.json", - false, - map[string]interface{}{ - "module": []map[string]interface{}{ - map[string]interface{}{ - "app": []map[string]interface{}{ - map[string]interface{}{"foo": ""}, - }, - }, - }, - }, - }, - { - "scientific.json", - false, - map[string]interface{}{ - "a": 1e-10, - "b": 1e+10, - "c": 1e10, - "d": 1.2e-10, - "e": 1.2e+10, - "f": 1.2e10, - }, - }, - { - "scientific.hcl", - false, - map[string]interface{}{ - "a": 1e-10, - "b": 1e+10, - "c": 1e10, - "d": 1.2e-10, - "e": 1.2e+10, - "f": 1.2e10, - }, - }, - { - "terraform_heroku.hcl", - false, - map[string]interface{}{ - "name": "terraform-test-app", - "config_vars": []map[string]interface{}{ - map[string]interface{}{ - "FOO": "bar", - }, - }, - }, - }, - { - "structure_multi.hcl", - false, - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{ - "baz": []map[string]interface{}{ - map[string]interface{}{"key": 7}, - }, - }, - map[string]interface{}{ - "bar": []map[string]interface{}{ - map[string]interface{}{"key": 12}, - }, - }, - }, - }, - }, - { - "structure_multi.json", - false, - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{ - "baz": []map[string]interface{}{ - map[string]interface{}{"key": 7}, - }, - }, - map[string]interface{}{ - "bar": []map[string]interface{}{ - map[string]interface{}{"key": 12}, - }, - }, - }, - }, - }, - { - "list_of_lists.hcl", - false, - map[string]interface{}{ - "foo": []interface{}{ - []interface{}{"foo"}, - []interface{}{"bar"}, - }, - }, - }, - { - "list_of_maps.hcl", - false, - map[string]interface{}{ - "foo": []interface{}{ - map[string]interface{}{"somekey1": "someval1"}, - map[string]interface{}{"somekey2": "someval2", "someextrakey": "someextraval"}, - }, - }, - }, - { - "assign_deep.hcl", - false, - map[string]interface{}{ - "resource": []interface{}{ - map[string]interface{}{ - "foo": []interface{}{ - map[string]interface{}{ - "bar": []map[string]interface{}{ - map[string]interface{}{}}}}}}}, - }, - { - "structure_list.hcl", - false, - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{ - "key": 7, - }, - map[string]interface{}{ - "key": 12, - }, - }, - }, - }, - { - "structure_list.json", - false, - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{ - "key": 7, - }, - map[string]interface{}{ - "key": 12, - }, - }, - }, - }, - { - "structure_list_deep.json", - false, - map[string]interface{}{ - "bar": []map[string]interface{}{ - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{ - "name": "terraform_example", - "ingress": []map[string]interface{}{ - map[string]interface{}{ - "from_port": 22, - }, - map[string]interface{}{ - "from_port": 80, - }, - }, - }, - }, - }, - }, - }, - }, - - { - "structure_list_empty.json", - false, - map[string]interface{}{ - "foo": []interface{}{}, - }, - }, - - { - "nested_block_comment.hcl", - false, - map[string]interface{}{ - "bar": "value", - }, - }, - - { - "unterminated_block_comment.hcl", - true, - nil, - }, - - { - "unterminated_brace.hcl", - true, - nil, - }, - - { - "nested_provider_bad.hcl", - true, - nil, - }, - - { - "object_list.json", - false, - map[string]interface{}{ - "resource": []map[string]interface{}{ - map[string]interface{}{ - "aws_instance": []map[string]interface{}{ - map[string]interface{}{ - "db": []map[string]interface{}{ - map[string]interface{}{ - "vpc": "foo", - "provisioner": []map[string]interface{}{ - map[string]interface{}{ - "file": []map[string]interface{}{ - map[string]interface{}{ - "source": "foo", - "destination": "bar", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - - // Terraform GH-8295 sanity test that basic decoding into - // interface{} works. - { - "terraform_variable_invalid.json", - false, - map[string]interface{}{ - "variable": []map[string]interface{}{ - map[string]interface{}{ - "whatever": "abc123", - }, - }, - }, - }, - - { - "interpolate.json", - false, - map[string]interface{}{ - "default": `${replace("europe-west", "-", " ")}`, - }, - }, - - { - "block_assign.hcl", - true, - nil, - }, - - { - "escape_backslash.hcl", - false, - map[string]interface{}{ - "output": []map[string]interface{}{ - map[string]interface{}{ - "one": `${replace(var.sub_domain, ".", "\\.")}`, - "two": `${replace(var.sub_domain, ".", "\\\\.")}`, - "many": `${replace(var.sub_domain, ".", "\\\\\\\\.")}`, - }, - }, - }, - }, - - { - "git_crypt.hcl", - true, - nil, - }, - - { - "object_with_bool.hcl", - false, - map[string]interface{}{ - "path": []map[string]interface{}{ - map[string]interface{}{ - "policy": "write", - "permissions": []map[string]interface{}{ - map[string]interface{}{ - "bool": []interface{}{false}, - }, - }, - }, - }, - }, - }, - } - - for _, tc := range cases { - t.Run(tc.File, func(t *testing.T) { - d, err := ioutil.ReadFile(filepath.Join(fixtureDir, tc.File)) - if err != nil { - t.Fatalf("err: %s", err) - } - - var out interface{} - err = Decode(&out, string(d)) - if (err != nil) != tc.Err { - t.Fatalf("Input: %s\n\nError: %s", tc.File, err) - } - - if !reflect.DeepEqual(out, tc.Out) { - t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out) - } - - var v interface{} - err = Unmarshal(d, &v) - if (err != nil) != tc.Err { - t.Fatalf("Input: %s\n\nError: %s", tc.File, err) - } - - if !reflect.DeepEqual(v, tc.Out) { - t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out) - } - }) - } -} - -func TestDecode_interfaceInline(t *testing.T) { - cases := []struct { - Value string - Err bool - Out interface{} - }{ - {"t t e{{}}", true, nil}, - {"t=0t d {}", true, map[string]interface{}{"t": 0}}, - {"v=0E0v d{}", true, map[string]interface{}{"v": float64(0)}}, - } - - for _, tc := range cases { - t.Logf("Testing: %q", tc.Value) - - var out interface{} - err := Decode(&out, tc.Value) - if (err != nil) != tc.Err { - t.Fatalf("Input: %q\n\nError: %s", tc.Value, err) - } - - if !reflect.DeepEqual(out, tc.Out) { - t.Fatalf("Input: %q. Actual, Expected.\n\n%#v\n\n%#v", tc.Value, out, tc.Out) - } - - var v interface{} - err = Unmarshal([]byte(tc.Value), &v) - if (err != nil) != tc.Err { - t.Fatalf("Input: %q\n\nError: %s", tc.Value, err) - } - - if !reflect.DeepEqual(v, tc.Out) { - t.Fatalf("Input: %q. Actual, Expected.\n\n%#v\n\n%#v", tc.Value, out, tc.Out) - } - } -} - -func TestDecode_equal(t *testing.T) { - cases := []struct { - One, Two string - }{ - { - "basic.hcl", - "basic.json", - }, - { - "float.hcl", - "float.json", - }, - /* - { - "structure.hcl", - "structure.json", - }, - */ - { - "structure.hcl", - "structure_flat.json", - }, - { - "terraform_heroku.hcl", - "terraform_heroku.json", - }, - } - - for _, tc := range cases { - p1 := filepath.Join(fixtureDir, tc.One) - p2 := filepath.Join(fixtureDir, tc.Two) - - d1, err := ioutil.ReadFile(p1) - if err != nil { - t.Fatalf("err: %s", err) - } - - d2, err := ioutil.ReadFile(p2) - if err != nil { - t.Fatalf("err: %s", err) - } - - var i1, i2 interface{} - err = Decode(&i1, string(d1)) - if err != nil { - t.Fatalf("err: %s", err) - } - - err = Decode(&i2, string(d2)) - if err != nil { - t.Fatalf("err: %s", err) - } - - if !reflect.DeepEqual(i1, i2) { - t.Fatalf( - "%s != %s\n\n%#v\n\n%#v", - tc.One, tc.Two, - i1, i2) - } - } -} - -func TestDecode_flatMap(t *testing.T) { - var val map[string]map[string]string - - err := Decode(&val, testReadFile(t, "structure_flatmap.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - expected := map[string]map[string]string{ - "foo": map[string]string{ - "foo": "bar", - "key": "7", - }, - } - - if !reflect.DeepEqual(val, expected) { - t.Fatalf("Actual: %#v\n\nExpected: %#v", val, expected) - } -} - -func TestDecode_structure(t *testing.T) { - type Embedded interface{} - - type V struct { - Embedded `hcl:"-"` - Key int - Foo string - } - - var actual V - - err := Decode(&actual, testReadFile(t, "flat.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - expected := V{ - Key: 7, - Foo: "bar", - } - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("Actual: %#v\n\nExpected: %#v", actual, expected) - } -} - -func TestDecode_structurePtr(t *testing.T) { - type V struct { - Key int - Foo string - } - - var actual *V - - err := Decode(&actual, testReadFile(t, "flat.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - expected := &V{ - Key: 7, - Foo: "bar", - } - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("Actual: %#v\n\nExpected: %#v", actual, expected) - } -} - -func TestDecode_structureArray(t *testing.T) { - // This test is extracted from a failure in Consul (consul.io), - // hence the interesting structure naming. - - type KeyPolicyType string - - type KeyPolicy struct { - Prefix string `hcl:",key"` - Policy KeyPolicyType - } - - type Policy struct { - Keys []KeyPolicy `hcl:"key,expand"` - } - - expected := Policy{ - Keys: []KeyPolicy{ - KeyPolicy{ - Prefix: "", - Policy: "read", - }, - KeyPolicy{ - Prefix: "foo/", - Policy: "write", - }, - KeyPolicy{ - Prefix: "foo/bar/", - Policy: "read", - }, - KeyPolicy{ - Prefix: "foo/bar/baz", - Policy: "deny", - }, - }, - } - - files := []string{ - "decode_policy.hcl", - "decode_policy.json", - } - - for _, f := range files { - var actual Policy - - err := Decode(&actual, testReadFile(t, f)) - if err != nil { - t.Fatalf("Input: %s\n\nerr: %s", f, err) - } - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) - } - } -} - -func TestDecode_sliceExpand(t *testing.T) { - type testInner struct { - Name string `hcl:",key"` - Key string - } - - type testStruct struct { - Services []testInner `hcl:"service,expand"` - } - - expected := testStruct{ - Services: []testInner{ - testInner{ - Name: "my-service-0", - Key: "value", - }, - testInner{ - Name: "my-service-1", - Key: "value", - }, - }, - } - - files := []string{ - "slice_expand.hcl", - } - - for _, f := range files { - t.Logf("Testing: %s", f) - - var actual testStruct - err := Decode(&actual, testReadFile(t, f)) - if err != nil { - t.Fatalf("Input: %s\n\nerr: %s", f, err) - } - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) - } - } -} - -func TestDecode_structureMap(t *testing.T) { - // This test is extracted from a failure in Terraform (terraform.io), - // hence the interesting structure naming. - - type hclVariable struct { - Default interface{} - Description string - Fields []string `hcl:",decodedFields"` - } - - type rawConfig struct { - Variable map[string]hclVariable - } - - expected := rawConfig{ - Variable: map[string]hclVariable{ - "foo": hclVariable{ - Default: "bar", - Description: "bar", - Fields: []string{"Default", "Description"}, - }, - - "amis": hclVariable{ - Default: []map[string]interface{}{ - map[string]interface{}{ - "east": "foo", - }, - }, - Fields: []string{"Default"}, - }, - }, - } - - files := []string{ - "decode_tf_variable.hcl", - "decode_tf_variable.json", - } - - for _, f := range files { - t.Logf("Testing: %s", f) - - var actual rawConfig - err := Decode(&actual, testReadFile(t, f)) - if err != nil { - t.Fatalf("Input: %s\n\nerr: %s", f, err) - } - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) - } - } -} - -func TestDecode_structureMapInvalid(t *testing.T) { - // Terraform GH-8295 - - type hclVariable struct { - Default interface{} - Description string - Fields []string `hcl:",decodedFields"` - } - - type rawConfig struct { - Variable map[string]*hclVariable - } - - var actual rawConfig - err := Decode(&actual, testReadFile(t, "terraform_variable_invalid.json")) - if err == nil { - t.Fatal("expected error") - } -} - -func TestDecode_interfaceNonPointer(t *testing.T) { - var value interface{} - err := Decode(value, testReadFile(t, "basic_int_string.hcl")) - if err == nil { - t.Fatal("should error") - } -} - -func TestDecode_intString(t *testing.T) { - var value struct { - Count int - } - - err := Decode(&value, testReadFile(t, "basic_int_string.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - if value.Count != 3 { - t.Fatalf("bad: %#v", value.Count) - } -} - -func TestDecode_float32(t *testing.T) { - var value struct { - A float32 `hcl:"a"` - B float32 `hcl:"b"` - } - - err := Decode(&value, testReadFile(t, "float.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - if got, want := value.A, float32(1.02); got != want { - t.Fatalf("wrong result %#v; want %#v", got, want) - } - if got, want := value.B, float32(2); got != want { - t.Fatalf("wrong result %#v; want %#v", got, want) - } -} - -func TestDecode_float64(t *testing.T) { - var value struct { - A float64 `hcl:"a"` - B float64 `hcl:"b"` - } - - err := Decode(&value, testReadFile(t, "float.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - if got, want := value.A, float64(1.02); got != want { - t.Fatalf("wrong result %#v; want %#v", got, want) - } - if got, want := value.B, float64(2); got != want { - t.Fatalf("wrong result %#v; want %#v", got, want) - } -} - -func TestDecode_intStringAliased(t *testing.T) { - var value struct { - Count time.Duration - } - - err := Decode(&value, testReadFile(t, "basic_int_string.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - if value.Count != time.Duration(3) { - t.Fatalf("bad: %#v", value.Count) - } -} - -func TestDecode_Node(t *testing.T) { - // given - var value struct { - Content ast.Node - Nested struct { - Content ast.Node - } - } - - content := ` -content { - hello = "world" -} -` - - // when - err := Decode(&value, content) - - // then - if err != nil { - t.Errorf("unable to decode content, %v", err) - return - } - - // verify ast.Node can be decoded later - var v map[string]interface{} - err = DecodeObject(&v, value.Content) - if err != nil { - t.Errorf("unable to decode content, %v", err) - return - } - - if v["hello"] != "world" { - t.Errorf("expected mapping to be returned") - } -} - -func TestDecode_NestedNode(t *testing.T) { - // given - var value struct { - Nested struct { - Content ast.Node - } - } - - content := ` -nested "content" { - hello = "world" -} -` - - // when - err := Decode(&value, content) - - // then - if err != nil { - t.Errorf("unable to decode content, %v", err) - return - } - - // verify ast.Node can be decoded later - var v map[string]interface{} - err = DecodeObject(&v, value.Nested.Content) - if err != nil { - t.Errorf("unable to decode content, %v", err) - return - } - - if v["hello"] != "world" { - t.Errorf("expected mapping to be returned") - } -} - -// https://github.com/hashicorp/hcl/issues/60 -func TestDecode_topLevelKeys(t *testing.T) { - type Template struct { - Source string - } - - templates := struct { - Templates []*Template `hcl:"template"` - }{} - - err := Decode(&templates, ` - template { - source = "blah" - } - - template { - source = "blahblah" - }`) - - if err != nil { - t.Fatal(err) - } - - if templates.Templates[0].Source != "blah" { - t.Errorf("bad source: %s", templates.Templates[0].Source) - } - - if templates.Templates[1].Source != "blahblah" { - t.Errorf("bad source: %s", templates.Templates[1].Source) - } -} - -func TestDecode_flattenedJSON(t *testing.T) { - // make sure we can also correctly extract a Name key too - type V struct { - Name string `hcl:",key"` - Description string - Default map[string]string - } - type Vars struct { - Variable []*V - } - - cases := []struct { - JSON string - Out interface{} - Expected interface{} - }{ - { // Nested object, no sibling keys - JSON: ` -{ - "var_name": { - "default": { - "key1": "a", - "key2": "b" - } - } -} - `, - Out: &[]*V{}, - Expected: &[]*V{ - &V{ - Name: "var_name", - Default: map[string]string{"key1": "a", "key2": "b"}, - }, - }, - }, - - { // Nested object with a sibling key (this worked previously) - JSON: ` -{ - "var_name": { - "description": "Described", - "default": { - "key1": "a", - "key2": "b" - } - } -} - `, - Out: &[]*V{}, - Expected: &[]*V{ - &V{ - Name: "var_name", - Description: "Described", - Default: map[string]string{"key1": "a", "key2": "b"}, - }, - }, - }, - - { // Multiple nested objects, one with a sibling key - JSON: ` -{ - "variable": { - "var_1": { - "default": { - "key1": "a", - "key2": "b" - } - }, - "var_2": { - "description": "Described", - "default": { - "key1": "a", - "key2": "b" - } - } - } -} - `, - Out: &Vars{}, - Expected: &Vars{ - Variable: []*V{ - &V{ - Name: "var_1", - Default: map[string]string{"key1": "a", "key2": "b"}, - }, - &V{ - Name: "var_2", - Description: "Described", - Default: map[string]string{"key1": "a", "key2": "b"}, - }, - }, - }, - }, - - { // Nested object to maps - JSON: ` -{ - "variable": { - "var_name": { - "description": "Described", - "default": { - "key1": "a", - "key2": "b" - } - } - } -} - `, - Out: &[]map[string]interface{}{}, - Expected: &[]map[string]interface{}{ - { - "variable": []map[string]interface{}{ - { - "var_name": []map[string]interface{}{ - { - "description": "Described", - "default": []map[string]interface{}{ - { - "key1": "a", - "key2": "b", - }, - }, - }, - }, - }, - }, - }, - }, - }, - - { // Nested object to maps without a sibling key should decode the same as above - JSON: ` -{ - "variable": { - "var_name": { - "default": { - "key1": "a", - "key2": "b" - } - } - } -} - `, - Out: &[]map[string]interface{}{}, - Expected: &[]map[string]interface{}{ - { - "variable": []map[string]interface{}{ - { - "var_name": []map[string]interface{}{ - { - "default": []map[string]interface{}{ - { - "key1": "a", - "key2": "b", - }, - }, - }, - }, - }, - }, - }, - }, - }, - - { // Nested objects, one with a sibling key, and one without - JSON: ` -{ - "variable": { - "var_1": { - "default": { - "key1": "a", - "key2": "b" - } - }, - "var_2": { - "description": "Described", - "default": { - "key1": "a", - "key2": "b" - } - } - } -} - `, - Out: &[]map[string]interface{}{}, - Expected: &[]map[string]interface{}{ - { - "variable": []map[string]interface{}{ - { - "var_1": []map[string]interface{}{ - { - "default": []map[string]interface{}{ - { - "key1": "a", - "key2": "b", - }, - }, - }, - }, - }, - }, - }, - { - "variable": []map[string]interface{}{ - { - "var_2": []map[string]interface{}{ - { - "description": "Described", - "default": []map[string]interface{}{ - { - "key1": "a", - "key2": "b", - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - - for i, tc := range cases { - err := Decode(tc.Out, tc.JSON) - if err != nil { - t.Fatalf("[%d] err: %s", i, err) - } - - if !reflect.DeepEqual(tc.Out, tc.Expected) { - t.Fatalf("[%d]\ngot: %s\nexpected: %s\n", i, spew.Sdump(tc.Out), spew.Sdump(tc.Expected)) - } - } -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/ast/ast_test.go b/vendor/github.com/hashicorp/hcl/hcl/ast/ast_test.go deleted file mode 100644 index 942256cad..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/ast/ast_test.go +++ /dev/null @@ -1,200 +0,0 @@ -package ast - -import ( - "reflect" - "strings" - "testing" - - "github.com/hashicorp/hcl/hcl/token" -) - -func TestObjectListFilter(t *testing.T) { - var cases = []struct { - Filter []string - Input []*ObjectItem - Output []*ObjectItem - }{ - { - []string{"foo"}, - []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{ - Token: token.Token{Type: token.STRING, Text: `"foo"`}, - }, - }, - }, - }, - []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{}, - }, - }, - }, - - { - []string{"foo"}, - []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, - }, - }, - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, - }, - }, - }, - []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, - }, - }, - }, - }, - } - - for _, tc := range cases { - input := &ObjectList{Items: tc.Input} - expected := &ObjectList{Items: tc.Output} - if actual := input.Filter(tc.Filter...); !reflect.DeepEqual(actual, expected) { - t.Fatalf("in order: input, expected, actual\n\n%#v\n\n%#v\n\n%#v", input, expected, actual) - } - } -} - -func TestWalk(t *testing.T) { - items := []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, - }, - Val: &LiteralType{Token: token.Token{Type: token.STRING, Text: `"example"`}}, - }, - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, - }, - }, - } - - node := &ObjectList{Items: items} - - order := []string{ - "*ast.ObjectList", - "*ast.ObjectItem", - "*ast.ObjectKey", - "*ast.ObjectKey", - "*ast.LiteralType", - "*ast.ObjectItem", - "*ast.ObjectKey", - } - count := 0 - - Walk(node, func(n Node) (Node, bool) { - if n == nil { - return n, false - } - - typeName := reflect.TypeOf(n).String() - if order[count] != typeName { - t.Errorf("expected '%s' got: '%s'", order[count], typeName) - } - count++ - return n, true - }) -} - -func TestWalkEquality(t *testing.T) { - items := []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, - }, - }, - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, - }, - }, - } - - node := &ObjectList{Items: items} - - rewritten := Walk(node, func(n Node) (Node, bool) { return n, true }) - - newNode, ok := rewritten.(*ObjectList) - if !ok { - t.Fatalf("expected Objectlist, got %T", rewritten) - } - - if !reflect.DeepEqual(node, newNode) { - t.Fatal("rewritten node is not equal to the given node") - } - - if len(newNode.Items) != 2 { - t.Error("expected newNode length 2, got: %d", len(newNode.Items)) - } - - expected := []string{ - `"foo"`, - `"bar"`, - } - - for i, item := range newNode.Items { - if len(item.Keys) != 1 { - t.Error("expected keys newNode length 1, got: %d", len(item.Keys)) - } - - if item.Keys[0].Token.Text != expected[i] { - t.Errorf("expected key %s, got %s", expected[i], item.Keys[0].Token.Text) - } - - if item.Val != nil { - t.Errorf("expected item value should be nil") - } - } -} - -func TestWalkRewrite(t *testing.T) { - items := []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, - }, - }, - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, - }, - }, - } - - node := &ObjectList{Items: items} - - suffix := "_example" - node = Walk(node, func(n Node) (Node, bool) { - switch i := n.(type) { - case *ObjectKey: - i.Token.Text = i.Token.Text + suffix - n = i - } - return n, true - }).(*ObjectList) - - Walk(node, func(n Node) (Node, bool) { - switch i := n.(type) { - case *ObjectKey: - if !strings.HasSuffix(i.Token.Text, suffix) { - t.Errorf("Token '%s' should have suffix: %s", i.Token.Text, suffix) - } - } - return n, true - }) - -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go deleted file mode 100644 index 2380d71e3..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go +++ /dev/null @@ -1,162 +0,0 @@ -// Derivative work from: -// - https://golang.org/src/cmd/gofmt/gofmt.go -// - https://github.com/fatih/hclfmt - -package fmtcmd - -import ( - "bytes" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "strings" - - "github.com/hashicorp/hcl/hcl/printer" -) - -var ( - ErrWriteStdin = errors.New("cannot use write option with standard input") -) - -type Options struct { - List bool // list files whose formatting differs - Write bool // write result to (source) file instead of stdout - Diff bool // display diffs of formatting changes -} - -func isValidFile(f os.FileInfo, extensions []string) bool { - if !f.IsDir() && !strings.HasPrefix(f.Name(), ".") { - for _, ext := range extensions { - if strings.HasSuffix(f.Name(), "."+ext) { - return true - } - } - } - - return false -} - -// If in == nil, the source is the contents of the file with the given filename. -func processFile(filename string, in io.Reader, out io.Writer, stdin bool, opts Options) error { - if in == nil { - f, err := os.Open(filename) - if err != nil { - return err - } - defer f.Close() - in = f - } - - src, err := ioutil.ReadAll(in) - if err != nil { - return err - } - - res, err := printer.Format(src) - if err != nil { - return fmt.Errorf("In %s: %s", filename, err) - } - - if !bytes.Equal(src, res) { - // formatting has changed - if opts.List { - fmt.Fprintln(out, filename) - } - if opts.Write { - err = ioutil.WriteFile(filename, res, 0644) - if err != nil { - return err - } - } - if opts.Diff { - data, err := diff(src, res) - if err != nil { - return fmt.Errorf("computing diff: %s", err) - } - fmt.Fprintf(out, "diff a/%s b/%s\n", filename, filename) - out.Write(data) - } - } - - if !opts.List && !opts.Write && !opts.Diff { - _, err = out.Write(res) - } - - return err -} - -func walkDir(path string, extensions []string, stdout io.Writer, opts Options) error { - visitFile := func(path string, f os.FileInfo, err error) error { - if err == nil && isValidFile(f, extensions) { - err = processFile(path, nil, stdout, false, opts) - } - return err - } - - return filepath.Walk(path, visitFile) -} - -func Run( - paths, extensions []string, - stdin io.Reader, - stdout io.Writer, - opts Options, -) error { - if len(paths) == 0 { - if opts.Write { - return ErrWriteStdin - } - if err := processFile("", stdin, stdout, true, opts); err != nil { - return err - } - return nil - } - - for _, path := range paths { - switch dir, err := os.Stat(path); { - case err != nil: - return err - case dir.IsDir(): - if err := walkDir(path, extensions, stdout, opts); err != nil { - return err - } - default: - if err := processFile(path, nil, stdout, false, opts); err != nil { - return err - } - } - } - - return nil -} - -func diff(b1, b2 []byte) (data []byte, err error) { - f1, err := ioutil.TempFile("", "") - if err != nil { - return - } - defer os.Remove(f1.Name()) - defer f1.Close() - - f2, err := ioutil.TempFile("", "") - if err != nil { - return - } - defer os.Remove(f2.Name()) - defer f2.Close() - - f1.Write(b1) - f2.Write(b2) - - data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOutput() - if len(data) > 0 { - // diff exits with a non-zero status when the files don't match. - // Ignore that failure as long as we get output. - err = nil - } - return -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go deleted file mode 100644 index b952d76d8..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go +++ /dev/null @@ -1,440 +0,0 @@ -// +build !windows -// TODO(jen20): These need fixing on Windows but fmt is not used right now -// and red CI is making it harder to process other bugs, so ignore until -// we get around to fixing them. - -package fmtcmd - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "reflect" - "regexp" - "sort" - "syscall" - "testing" - - "github.com/hashicorp/hcl/testhelper" -) - -var fixtureExtensions = []string{"hcl"} - -func init() { - sort.Sort(ByFilename(fixtures)) -} - -func TestIsValidFile(t *testing.T) { - const fixtureDir = "./test-fixtures" - - cases := []struct { - Path string - Expected bool - }{ - {"good.hcl", true}, - {".hidden.ignore", false}, - {"file.ignore", false}, - {"dir.ignore", false}, - } - - for _, tc := range cases { - file, err := os.Stat(filepath.Join(fixtureDir, tc.Path)) - if err != nil { - t.Errorf("unexpected error: %s", err) - } - - if res := isValidFile(file, fixtureExtensions); res != tc.Expected { - t.Errorf("want: %b, got: %b", tc.Expected, res) - } - } -} - -func TestRunMultiplePaths(t *testing.T) { - path1, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path1) - path2, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path2) - - var expectedOut bytes.Buffer - for _, path := range []string{path1, path2} { - for _, fixture := range fixtures { - if !bytes.Equal(fixture.golden, fixture.input) { - expectedOut.WriteString(filepath.Join(path, fixture.filename) + "\n") - } - } - } - - _, stdout := mockIO() - err = Run( - []string{path1, path2}, - fixtureExtensions, - nil, stdout, - Options{ - List: true, - }, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if stdout.String() != expectedOut.String() { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) - } -} - -func TestRunSubDirectories(t *testing.T) { - pathParent, err := ioutil.TempDir("", "") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(pathParent) - - path1, err := renderFixtures(pathParent) - if err != nil { - t.Errorf("unexpected error: %s", err) - } - path2, err := renderFixtures(pathParent) - if err != nil { - t.Errorf("unexpected error: %s", err) - } - - paths := []string{path1, path2} - sort.Strings(paths) - - var expectedOut bytes.Buffer - for _, path := range paths { - for _, fixture := range fixtures { - if !bytes.Equal(fixture.golden, fixture.input) { - expectedOut.WriteString(filepath.Join(path, fixture.filename) + "\n") - } - } - } - - _, stdout := mockIO() - err = Run( - []string{pathParent}, - fixtureExtensions, - nil, stdout, - Options{ - List: true, - }, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if stdout.String() != expectedOut.String() { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) - } -} - -func TestRunStdin(t *testing.T) { - var expectedOut bytes.Buffer - for i, fixture := range fixtures { - if i != 0 { - expectedOut.WriteString("\n") - } - expectedOut.Write(fixture.golden) - } - - stdin, stdout := mockIO() - for _, fixture := range fixtures { - stdin.Write(fixture.input) - } - - err := Run( - []string{}, - fixtureExtensions, - stdin, stdout, - Options{}, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if !bytes.Equal(stdout.Bytes(), expectedOut.Bytes()) { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) - } -} - -func TestRunStdinAndWrite(t *testing.T) { - var expectedOut = []byte{} - - stdin, stdout := mockIO() - stdin.WriteString("") - err := Run( - []string{}, []string{}, - stdin, stdout, - Options{ - Write: true, - }, - ) - - if err != ErrWriteStdin { - t.Errorf("error want:\n%s\ngot:\n%s", ErrWriteStdin, err) - } - if !bytes.Equal(stdout.Bytes(), expectedOut) { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) - } -} - -func TestRunFileError(t *testing.T) { - path, err := ioutil.TempDir("", "") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path) - filename := filepath.Join(path, "unreadable.hcl") - - var expectedError = &os.PathError{ - Op: "open", - Path: filename, - Err: syscall.EACCES, - } - - err = ioutil.WriteFile(filename, []byte{}, 0000) - if err != nil { - t.Errorf("unexpected error: %s", err) - } - - _, stdout := mockIO() - err = Run( - []string{path}, - fixtureExtensions, - nil, stdout, - Options{}, - ) - - if !reflect.DeepEqual(err, expectedError) { - t.Errorf("error want: %#v, got: %#v", expectedError, err) - } -} - -func TestRunNoOptions(t *testing.T) { - path, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path) - - var expectedOut bytes.Buffer - for _, fixture := range fixtures { - expectedOut.Write(fixture.golden) - } - - _, stdout := mockIO() - err = Run( - []string{path}, - fixtureExtensions, - nil, stdout, - Options{}, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if stdout.String() != expectedOut.String() { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) - } -} - -func TestRunList(t *testing.T) { - path, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path) - - var expectedOut bytes.Buffer - for _, fixture := range fixtures { - if !bytes.Equal(fixture.golden, fixture.input) { - expectedOut.WriteString(fmt.Sprintln(filepath.Join(path, fixture.filename))) - } - } - - _, stdout := mockIO() - err = Run( - []string{path}, - fixtureExtensions, - nil, stdout, - Options{ - List: true, - }, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if stdout.String() != expectedOut.String() { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) - } -} - -func TestRunWrite(t *testing.T) { - path, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path) - - _, stdout := mockIO() - err = Run( - []string{path}, - fixtureExtensions, - nil, stdout, - Options{ - Write: true, - }, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - for _, fixture := range fixtures { - res, err := ioutil.ReadFile(filepath.Join(path, fixture.filename)) - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if !bytes.Equal(res, fixture.golden) { - t.Errorf("file %q contents want:\n%s\ngot:\n%s", fixture.filename, fixture.golden, res) - } - } -} - -func TestRunDiff(t *testing.T) { - path, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path) - - var expectedOut bytes.Buffer - for _, fixture := range fixtures { - if len(fixture.diff) > 0 { - expectedOut.WriteString( - regexp.QuoteMeta( - fmt.Sprintf("diff a/%s/%s b/%s/%s\n", path, fixture.filename, path, fixture.filename), - ), - ) - // Need to use regex to ignore datetimes in diff. - expectedOut.WriteString(`--- .+?\n`) - expectedOut.WriteString(`\+\+\+ .+?\n`) - expectedOut.WriteString(regexp.QuoteMeta(string(fixture.diff))) - } - } - - expectedOutString := testhelper.Unix2dos(expectedOut.String()) - - _, stdout := mockIO() - err = Run( - []string{path}, - fixtureExtensions, - nil, stdout, - Options{ - Diff: true, - }, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if !regexp.MustCompile(expectedOutString).Match(stdout.Bytes()) { - t.Errorf("stdout want match:\n%s\ngot:\n%q", expectedOutString, stdout) - } -} - -func mockIO() (stdin, stdout *bytes.Buffer) { - return new(bytes.Buffer), new(bytes.Buffer) -} - -type fixture struct { - filename string - input, golden, diff []byte -} - -type ByFilename []fixture - -func (s ByFilename) Len() int { return len(s) } -func (s ByFilename) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s ByFilename) Less(i, j int) bool { return len(s[i].filename) > len(s[j].filename) } - -var fixtures = []fixture{ - { - "noop.hcl", - []byte(`resource "aws_security_group" "firewall" { - count = 5 -} -`), - []byte(`resource "aws_security_group" "firewall" { - count = 5 -} -`), - []byte(``), - }, { - "align_equals.hcl", - []byte(`variable "foo" { - default = "bar" - description = "bar" -} -`), - []byte(`variable "foo" { - default = "bar" - description = "bar" -} -`), - []byte(`@@ -1,4 +1,4 @@ - variable "foo" { -- default = "bar" -+ default = "bar" - description = "bar" - } -`), - }, { - "indentation.hcl", - []byte(`provider "aws" { - access_key = "foo" - secret_key = "bar" -} -`), - []byte(`provider "aws" { - access_key = "foo" - secret_key = "bar" -} -`), - []byte(`@@ -1,4 +1,4 @@ - provider "aws" { -- access_key = "foo" -- secret_key = "bar" -+ access_key = "foo" -+ secret_key = "bar" - } -`), - }, -} - -// parent can be an empty string, in which case the system's default -// temporary directory will be used. -func renderFixtures(parent string) (path string, err error) { - path, err = ioutil.TempDir(parent, "") - if err != nil { - return "", err - } - - for _, fixture := range fixtures { - err = ioutil.WriteFile(filepath.Join(path, fixture.filename), []byte(fixture.input), 0644) - if err != nil { - os.RemoveAll(path) - return "", err - } - } - - return path, nil -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore deleted file mode 100644 index 9977a2836..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore +++ /dev/null @@ -1 +0,0 @@ -invalid diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/dir.ignore b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/dir.ignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore deleted file mode 100644 index 9977a2836..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore +++ /dev/null @@ -1 +0,0 @@ -invalid diff --git a/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/good.hcl b/vendor/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/good.hcl deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/error_test.go b/vendor/github.com/hashicorp/hcl/hcl/parser/error_test.go deleted file mode 100644 index 32399fec5..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/error_test.go +++ /dev/null @@ -1,9 +0,0 @@ -package parser - -import ( - "testing" -) - -func TestPosError_impl(t *testing.T) { - var _ error = new(PosError) -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go b/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go index 098e1bc49..64c83bcfb 100644 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go +++ b/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go @@ -205,6 +205,12 @@ func (p *Parser) objectItem() (*ast.ObjectItem, error) { } } + // key=#comment + // val + if p.lineComment != nil { + o.LineComment, p.lineComment = p.lineComment, nil + } + // do a look-ahead for line comment p.scan() if len(keys) > 0 && o.Val.Pos().Line == keys[0].Pos().Line && p.lineComment != nil { diff --git a/vendor/github.com/hashicorp/hcl/hcl/parser/parser_test.go b/vendor/github.com/hashicorp/hcl/hcl/parser/parser_test.go deleted file mode 100644 index 270212207..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/parser/parser_test.go +++ /dev/null @@ -1,575 +0,0 @@ -package parser - -import ( - "fmt" - "io/ioutil" - "path/filepath" - "reflect" - "runtime" - "strings" - "testing" - - "github.com/hashicorp/hcl/hcl/ast" - "github.com/hashicorp/hcl/hcl/token" -) - -func TestType(t *testing.T) { - var literals = []struct { - typ token.Type - src string - }{ - {token.STRING, `foo = "foo"`}, - {token.NUMBER, `foo = 123`}, - {token.NUMBER, `foo = -29`}, - {token.FLOAT, `foo = 123.12`}, - {token.FLOAT, `foo = -123.12`}, - {token.BOOL, `foo = true`}, - {token.HEREDOC, "foo = < 0 && !lastHadLeadComment { - buf.WriteByte(newline) - } - - for _, comment := range lit.LeadComment.List { - buf.Write(p.indent([]byte(comment.Text))) - buf.WriteByte(newline) - } + // If we have a lead comment, then we want to write that first + leadComment := false + if lit, ok := item.(*ast.LiteralType); ok && lit.LeadComment != nil { + leadComment = true + + // Ensure an empty line before every element with a + // lead comment (except the first item in a list). + if !haveEmptyLine && i != 0 { + buf.WriteByte(newline) } - // also indent each line - val := p.output(item) - curLen := len(val) - buf.Write(p.indent(val)) - - // if this item is a heredoc, then we output the comma on - // the next line. This is the only case this happens. - comma := []byte{','} - if heredoc { + for _, comment := range lit.LeadComment.List { + buf.Write(p.indent([]byte(comment.Text))) buf.WriteByte(newline) - comma = p.indent(comma) } + } - buf.Write(comma) + // also indent each line + val := p.output(item) + curLen := len(val) + buf.Write(p.indent(val)) - if lit, ok := item.(*ast.LiteralType); ok && lit.LineComment != nil { - // if the next item doesn't have any comments, do not align - buf.WriteByte(blank) // align one space - for i := 0; i < longestLine-curLen; i++ { - buf.WriteByte(blank) - } + // if this item is a heredoc, then we output the comma on + // the next line. This is the only case this happens. + comma := []byte{','} + if lit, ok := item.(*ast.LiteralType); ok && lit.Token.Type == token.HEREDOC { + buf.WriteByte(newline) + comma = p.indent(comma) + } - for _, comment := range lit.LineComment.List { - buf.WriteString(comment.Text) - } - } + buf.Write(comma) - lastItem := i == len(l.List)-1 - if lastItem { - buf.WriteByte(newline) + if lit, ok := item.(*ast.LiteralType); ok && lit.LineComment != nil { + // if the next item doesn't have any comments, do not align + buf.WriteByte(blank) // align one space + for i := 0; i < longestLine-curLen; i++ { + buf.WriteByte(blank) } - if leadComment && !lastItem { - buf.WriteByte(newline) + for _, comment := range lit.LineComment.List { + buf.WriteString(comment.Text) } + } - lastHadLeadComment = leadComment - } else { - if insertSpaceBeforeItem { - buf.WriteByte(blank) - insertSpaceBeforeItem = false - } + buf.WriteByte(newline) - // Output the item itself - // also indent each line - val := p.output(item) - curLen := len(val) - buf.Write(val) + // Ensure an empty line after every element with a + // lead comment (except the first item in a list). + haveEmptyLine = leadComment && i != len(l.List)-1 + if haveEmptyLine { + buf.WriteByte(newline) + } + } - // If this is a heredoc item we always have to output a newline - // so that it parses properly. - if heredoc { - buf.WriteByte(newline) - } + buf.WriteString("]") + return buf.Bytes() +} - // If this isn't the last element, write a comma. - if i != len(l.List)-1 { - buf.WriteString(",") - insertSpaceBeforeItem = true - } +// isSingleLineList returns true if: +// * they were previously formatted entirely on one line +// * they consist entirely of literals +// * there are either no heredoc strings or the list has exactly one element +// * there are no line comments +func (printer) isSingleLineList(l *ast.ListType) bool { + for _, item := range l.List { + if item.Pos().Line != l.Lbrack.Line { + return false + } - if lit, ok := item.(*ast.LiteralType); ok && lit.LineComment != nil { - // if the next item doesn't have any comments, do not align - buf.WriteByte(blank) // align one space - for i := 0; i < longestLine-curLen; i++ { - buf.WriteByte(blank) - } + lit, ok := item.(*ast.LiteralType) + if !ok { + return false + } - for _, comment := range lit.LineComment.List { - buf.WriteString(comment.Text) - } - } + if lit.Token.Type == token.HEREDOC && len(l.List) != 1 { + return false + } + + if lit.LineComment != nil { + return false + } + } + + return true +} + +// singleLineList prints a simple single line list. +// For a definition of "simple", see isSingleLineList above. +func (p *printer) singleLineList(l *ast.ListType) []byte { + buf := &bytes.Buffer{} + + buf.WriteString("[") + for i, item := range l.List { + if i != 0 { + buf.WriteString(", ") } + // Output the item itself + buf.Write(p.output(item)) + + // The heredoc marker needs to be at the end of line. + if lit, ok := item.(*ast.LiteralType); ok && lit.Token.Type == token.HEREDOC { + buf.WriteByte(newline) + } } buf.WriteString("]") diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go b/vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go deleted file mode 100644 index 5248259b9..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/printer_test.go +++ /dev/null @@ -1,149 +0,0 @@ -package printer - -import ( - "bytes" - "errors" - "flag" - "fmt" - "io/ioutil" - "path/filepath" - "testing" - - "github.com/hashicorp/hcl/hcl/parser" -) - -var update = flag.Bool("update", false, "update golden files") - -const ( - dataDir = "testdata" -) - -type entry struct { - source, golden string -} - -// Use go test -update to create/update the respective golden files. -var data = []entry{ - {"complexhcl.input", "complexhcl.golden"}, - {"list.input", "list.golden"}, - {"list_comment.input", "list_comment.golden"}, - {"comment.input", "comment.golden"}, - {"comment_crlf.input", "comment.golden"}, - {"comment_aligned.input", "comment_aligned.golden"}, - {"comment_array.input", "comment_array.golden"}, - {"comment_end_file.input", "comment_end_file.golden"}, - {"comment_multiline_indent.input", "comment_multiline_indent.golden"}, - {"comment_multiline_no_stanza.input", "comment_multiline_no_stanza.golden"}, - {"comment_multiline_stanza.input", "comment_multiline_stanza.golden"}, - {"comment_newline.input", "comment_newline.golden"}, - {"comment_object_multi.input", "comment_object_multi.golden"}, - {"comment_standalone.input", "comment_standalone.golden"}, - {"empty_block.input", "empty_block.golden"}, - {"list_of_objects.input", "list_of_objects.golden"}, - {"multiline_string.input", "multiline_string.golden"}, - {"object_singleline.input", "object_singleline.golden"}, - {"object_with_heredoc.input", "object_with_heredoc.golden"}, -} - -func TestFiles(t *testing.T) { - for _, e := range data { - source := filepath.Join(dataDir, e.source) - golden := filepath.Join(dataDir, e.golden) - t.Run(e.source, func(t *testing.T) { - check(t, source, golden) - }) - } -} - -func check(t *testing.T, source, golden string) { - src, err := ioutil.ReadFile(source) - if err != nil { - t.Error(err) - return - } - - res, err := format(src) - if err != nil { - t.Error(err) - return - } - - // update golden files if necessary - if *update { - if err := ioutil.WriteFile(golden, res, 0644); err != nil { - t.Error(err) - } - return - } - - // get golden - gld, err := ioutil.ReadFile(golden) - if err != nil { - t.Error(err) - return - } - - // formatted source and golden must be the same - if err := diff(source, golden, res, gld); err != nil { - t.Error(err) - return - } -} - -// diff compares a and b. -func diff(aname, bname string, a, b []byte) error { - var buf bytes.Buffer // holding long error message - - // compare lengths - if len(a) != len(b) { - fmt.Fprintf(&buf, "\nlength changed: len(%s) = %d, len(%s) = %d", aname, len(a), bname, len(b)) - } - - // compare contents - line := 1 - offs := 1 - for i := 0; i < len(a) && i < len(b); i++ { - ch := a[i] - if ch != b[i] { - fmt.Fprintf(&buf, "\n%s:%d:%d: %q", aname, line, i-offs+1, lineAt(a, offs)) - fmt.Fprintf(&buf, "\n%s:%d:%d: %q", bname, line, i-offs+1, lineAt(b, offs)) - fmt.Fprintf(&buf, "\n\n") - break - } - if ch == '\n' { - line++ - offs = i + 1 - } - } - - if buf.Len() > 0 { - return errors.New(buf.String()) - } - return nil -} - -// format parses src, prints the corresponding AST, verifies the resulting -// src is syntactically correct, and returns the resulting src or an error -// if any. -func format(src []byte) ([]byte, error) { - formatted, err := Format(src) - if err != nil { - return nil, err - } - - // make sure formatted output is syntactically correct - if _, err := parser.Parse(formatted); err != nil { - return nil, fmt.Errorf("parse: %s\n%s", err, formatted) - } - - return formatted, nil -} - -// lineAt returns the line in text starting at offset offs. -func lineAt(text []byte, offs int) []byte { - i := offs - for i < len(text) && text[i] != '\n' { - i++ - } - return text[offs:i] -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden deleted file mode 100644 index 9d4b072a0..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden +++ /dev/null @@ -1,36 +0,0 @@ -// A standalone comment is a comment which is not attached to any kind of node - -// This comes from Terraform, as a test -variable "foo" { - # Standalone comment should be still here - - default = "bar" - description = "bar" # yooo -} - -/* This is a multi line standalone -comment*/ - -// fatih arslan -/* This is a developer test -account and a multine comment */ -developer = ["fatih", "arslan"] // fatih arslan - -# One line here -numbers = [1, 2] // another line here - -# Another comment -variable = { - description = "bar" # another yooo - - foo { - # Nested standalone - - bar = "fatih" - } -} - -// lead comment -foo { - bar = "fatih" // line comment 2 -} // line comment 3 diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input deleted file mode 100644 index 57c37ac1d..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input +++ /dev/null @@ -1,37 +0,0 @@ -// A standalone comment is a comment which is not attached to any kind of node - - // This comes from Terraform, as a test -variable "foo" { - # Standalone comment should be still here - - default = "bar" - description = "bar" # yooo -} - -/* This is a multi line standalone -comment*/ - - -// fatih arslan -/* This is a developer test -account and a multine comment */ -developer = [ "fatih", "arslan"] // fatih arslan - -# One line here -numbers = [1,2] // another line here - - # Another comment -variable = { - description = "bar" # another yooo - foo { - # Nested standalone - - bar = "fatih" - } -} - - // lead comment -foo { - bar = "fatih" // line comment 2 -} // line comment 3 - diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden deleted file mode 100644 index 6ff21504c..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden +++ /dev/null @@ -1,32 +0,0 @@ -aligned { - # We have some aligned items below - foo = "fatih" # yoo1 - default = "bar" # yoo2 - bar = "bar and foo" # yoo3 - - default = { - bar = "example" - } - - #deneme arslan - fatih = ["fatih"] # yoo4 - - #fatih arslan - fatiharslan = ["arslan"] // yoo5 - - default = { - bar = "example" - } - - security_groups = [ - "foo", # kenya 1 - "${aws_security_group.firewall.foo}", # kenya 2 - ] - - security_groups2 = [ - "foo", # kenya 1 - "bar", # kenya 1.5 - "${aws_security_group.firewall.foo}", # kenya 2 - "foobar", # kenya 3 - ] -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input deleted file mode 100644 index bd43ab1ad..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input +++ /dev/null @@ -1,28 +0,0 @@ -aligned { -# We have some aligned items below - foo = "fatih" # yoo1 - default = "bar" # yoo2 - bar = "bar and foo" # yoo3 - default = { - bar = "example" - } - #deneme arslan - fatih = ["fatih"] # yoo4 - #fatih arslan - fatiharslan = ["arslan"] // yoo5 - default = { - bar = "example" - } - -security_groups = [ - "foo", # kenya 1 - "${aws_security_group.firewall.foo}", # kenya 2 -] - -security_groups2 = [ - "foo", # kenya 1 - "bar", # kenya 1.5 - "${aws_security_group.firewall.foo}", # kenya 2 - "foobar", # kenya 3 -] -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden deleted file mode 100644 index e778eafa3..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden +++ /dev/null @@ -1,13 +0,0 @@ -banana = [ - # I really want to comment this item in the array. - "a", - - # This as well - "b", - - "c", # And C - "d", - - # And another - "e", -] diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input deleted file mode 100644 index e778eafa3..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input +++ /dev/null @@ -1,13 +0,0 @@ -banana = [ - # I really want to comment this item in the array. - "a", - - # This as well - "b", - - "c", # And C - "d", - - # And another - "e", -] diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input deleted file mode 100644 index 5d2720672..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input +++ /dev/null @@ -1,37 +0,0 @@ -// A standalone comment is a comment which is not attached to any kind of node - - // This comes from Terraform, as a test -variable "foo" { - # Standalone comment should be still here - - default = "bar" - description = "bar" # yooo -} - -/* This is a multi line standalone -comment*/ - - -// fatih arslan -/* This is a developer test -account and a multine comment */ -developer = [ "fatih", "arslan"] // fatih arslan - -# One line here -numbers = [1,2] // another line here - - # Another comment -variable = { - description = "bar" # another yooo - foo { - # Nested standalone - - bar = "fatih" - } -} - - // lead comment -foo { - bar = "fatih" // line comment 2 -} // line comment 3 - diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden deleted file mode 100644 index dbeae36a8..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden +++ /dev/null @@ -1,6 +0,0 @@ -resource "blah" "blah" {} - -// -// -// - diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input deleted file mode 100644 index 68c4c282e..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input +++ /dev/null @@ -1,5 +0,0 @@ -resource "blah" "blah" {} - -// -// -// diff --git a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden b/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden deleted file mode 100644 index 74c4ccd89..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden +++ /dev/null @@ -1,12 +0,0 @@ -resource "provider" "resource" { - /* - SPACE_SENSITIVE_CODE = < 0 { + if ch == '\x00' { s.err("unexpected null character (0x00)") return eof } + if ch == '\uE123' { + s.err("unicode code point U+E123 reserved for internal use") + return utf8.RuneError + } + // debug // fmt.Printf("ch: %q, offset:column: %d:%d\n", ch, s.srcPos.Offset, s.srcPos.Column) return ch @@ -432,16 +433,16 @@ func (s *Scanner) scanHeredoc() { // Read the identifier identBytes := s.src[offs : s.srcPos.Offset-s.lastCharLen] - if len(identBytes) == 0 { + if len(identBytes) == 0 || (len(identBytes) == 1 && identBytes[0] == '-') { s.err("zero-length heredoc anchor") return } var identRegexp *regexp.Regexp if identBytes[0] == '-' { - identRegexp = regexp.MustCompile(fmt.Sprintf(`[[:space:]]*%s\z`, identBytes[1:])) + identRegexp = regexp.MustCompile(fmt.Sprintf(`^[[:space:]]*%s\r*\z`, identBytes[1:])) } else { - identRegexp = regexp.MustCompile(fmt.Sprintf(`[[:space:]]*%s\z`, identBytes)) + identRegexp = regexp.MustCompile(fmt.Sprintf(`^[[:space:]]*%s\r*\z`, identBytes)) } // Read the actual string value @@ -551,7 +552,7 @@ func (s *Scanner) scanDigits(ch rune, base, n int) rune { s.err("illegal char escape") } - if n != start { + if n != start && ch != eof { // we scanned all digits, put the last non digit char back, // only if we read anything at all s.unread() diff --git a/vendor/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go b/vendor/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go deleted file mode 100644 index 4f2c9cbe0..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go +++ /dev/null @@ -1,591 +0,0 @@ -package scanner - -import ( - "bytes" - "fmt" - "testing" - - "strings" - - "github.com/hashicorp/hcl/hcl/token" -) - -var f100 = strings.Repeat("f", 100) - -type tokenPair struct { - tok token.Type - text string -} - -var tokenLists = map[string][]tokenPair{ - "comment": []tokenPair{ - {token.COMMENT, "//"}, - {token.COMMENT, "////"}, - {token.COMMENT, "// comment"}, - {token.COMMENT, "// /* comment */"}, - {token.COMMENT, "// // comment //"}, - {token.COMMENT, "//" + f100}, - {token.COMMENT, "#"}, - {token.COMMENT, "##"}, - {token.COMMENT, "# comment"}, - {token.COMMENT, "# /* comment */"}, - {token.COMMENT, "# # comment #"}, - {token.COMMENT, "#" + f100}, - {token.COMMENT, "/**/"}, - {token.COMMENT, "/***/"}, - {token.COMMENT, "/* comment */"}, - {token.COMMENT, "/* // comment */"}, - {token.COMMENT, "/* /* comment */"}, - {token.COMMENT, "/*\n comment\n*/"}, - {token.COMMENT, "/*" + f100 + "*/"}, - }, - "operator": []tokenPair{ - {token.LBRACK, "["}, - {token.LBRACE, "{"}, - {token.COMMA, ","}, - {token.PERIOD, "."}, - {token.RBRACK, "]"}, - {token.RBRACE, "}"}, - {token.ASSIGN, "="}, - {token.ADD, "+"}, - {token.SUB, "-"}, - }, - "bool": []tokenPair{ - {token.BOOL, "true"}, - {token.BOOL, "false"}, - }, - "ident": []tokenPair{ - {token.IDENT, "a"}, - {token.IDENT, "a0"}, - {token.IDENT, "foobar"}, - {token.IDENT, "foo-bar"}, - {token.IDENT, "abc123"}, - {token.IDENT, "LGTM"}, - {token.IDENT, "_"}, - {token.IDENT, "_abc123"}, - {token.IDENT, "abc123_"}, - {token.IDENT, "_abc_123_"}, - {token.IDENT, "_äöü"}, - {token.IDENT, "_本"}, - {token.IDENT, "äöü"}, - {token.IDENT, "本"}, - {token.IDENT, "a۰۱۸"}, - {token.IDENT, "foo६४"}, - {token.IDENT, "bar9876"}, - }, - "heredoc": []tokenPair{ - {token.HEREDOC, "< 0 for %q", s.ErrorCount, src) - } -} - -func testTokenList(t *testing.T, tokenList []tokenPair) { - // create artifical source code - buf := new(bytes.Buffer) - for _, ident := range tokenList { - fmt.Fprintf(buf, "%s\n", ident.text) - } - - s := New(buf.Bytes()) - for _, ident := range tokenList { - tok := s.Scan() - if tok.Type != ident.tok { - t.Errorf("tok = %q want %q for %q\n", tok, ident.tok, ident.text) - } - - if tok.Text != ident.text { - t.Errorf("text = %q want %q", tok.String(), ident.text) - } - - } -} - -func countNewlines(s string) int { - n := 0 - for _, ch := range s { - if ch == '\n' { - n++ - } - } - return n -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/strconv/quote_test.go b/vendor/github.com/hashicorp/hcl/hcl/strconv/quote_test.go deleted file mode 100644 index 65be375d9..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/strconv/quote_test.go +++ /dev/null @@ -1,96 +0,0 @@ -package strconv - -import "testing" - -type quoteTest struct { - in string - out string - ascii string -} - -var quotetests = []quoteTest{ - {"\a\b\f\r\n\t\v", `"\a\b\f\r\n\t\v"`, `"\a\b\f\r\n\t\v"`}, - {"\\", `"\\"`, `"\\"`}, - {"abc\xffdef", `"abc\xffdef"`, `"abc\xffdef"`}, - {"\u263a", `"☺"`, `"\u263a"`}, - {"\U0010ffff", `"\U0010ffff"`, `"\U0010ffff"`}, - {"\x04", `"\x04"`, `"\x04"`}, -} - -type unQuoteTest struct { - in string - out string -} - -var unquotetests = []unQuoteTest{ - {`""`, ""}, - {`"a"`, "a"}, - {`"abc"`, "abc"}, - {`"☺"`, "☺"}, - {`"hello world"`, "hello world"}, - {`"\xFF"`, "\xFF"}, - {`"\377"`, "\377"}, - {`"\u1234"`, "\u1234"}, - {`"\U00010111"`, "\U00010111"}, - {`"\U0001011111"`, "\U0001011111"}, - {`"\a\b\f\n\r\t\v\\\""`, "\a\b\f\n\r\t\v\\\""}, - {`"'"`, "'"}, - {`"${file("foo")}"`, `${file("foo")}`}, - {`"${file("\"foo\"")}"`, `${file("\"foo\"")}`}, - {`"echo ${var.region}${element(split(",",var.zones),0)}"`, - `echo ${var.region}${element(split(",",var.zones),0)}`}, - {`"${HH\\:mm\\:ss}"`, `${HH\\:mm\\:ss}`}, - {`"${\n}"`, `${\n}`}, -} - -var misquoted = []string{ - ``, - `"`, - `"a`, - `"'`, - `b"`, - `"\"`, - `"\9"`, - `"\19"`, - `"\129"`, - `'\'`, - `'\9'`, - `'\19'`, - `'\129'`, - `'ab'`, - `"\x1!"`, - `"\U12345678"`, - `"\z"`, - "`", - "`xxx", - "`\"", - `"\'"`, - `'\"'`, - "\"\n\"", - "\"\\n\n\"", - "'\n'", - `"${"`, - `"${foo{}"`, - "\"${foo}\n\"", -} - -func TestUnquote(t *testing.T) { - for _, tt := range unquotetests { - if out, err := Unquote(tt.in); err != nil || out != tt.out { - t.Errorf("Unquote(%#q) = %q, %v want %q, nil", tt.in, out, err, tt.out) - } - } - - // run the quote tests too, backward - for _, tt := range quotetests { - if in, err := Unquote(tt.out); in != tt.in { - t.Errorf("Unquote(%#q) = %q, %v, want %q, nil", tt.out, in, err, tt.in) - } - } - - for _, s := range misquoted { - if out, err := Unquote(s); out != "" || err != ErrSyntax { - t.Errorf("Unquote(%#q) = %q, %v want %q, %v", s, out, err, "", ErrSyntax) - } - } -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl deleted file mode 100644 index 78c267582..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl +++ /dev/null @@ -1,4 +0,0 @@ -foo = [ - "1", - "2", # comment -] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl deleted file mode 100644 index eb5a99a69..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl +++ /dev/null @@ -1,6 +0,0 @@ -resource = [{ - "foo": { - "bar": {}, - "baz": [1, 2, "foo"], - } -}] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl deleted file mode 100644 index 1ff7f29fd..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl +++ /dev/null @@ -1,15 +0,0 @@ -// Foo - -/* Bar */ - -/* -/* -Baz -*/ - -# Another - -# Multiple -# Lines - -foo = "bar" diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl deleted file mode 100644 index fec56017d..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl +++ /dev/null @@ -1 +0,0 @@ -# Hello diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl deleted file mode 100644 index cccb5b06f..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl +++ /dev/null @@ -1,42 +0,0 @@ -// This comes from Terraform, as a test -variable "foo" { - default = "bar" - description = "bar" -} - -provider "aws" { - access_key = "foo" - secret_key = "bar" -} - -provider "do" { - api_key = "${var.foo}" -} - -resource "aws_security_group" "firewall" { - count = 5 -} - -resource aws_instance "web" { - ami = "${var.foo}" - security_groups = [ - "foo", - "${aws_security_group.firewall.foo}" - ] - - network_interface { - device_index = 0 - description = "Main network interface" - } -} - -resource "aws_instance" "db" { - security_groups = "${aws_security_group.firewall.*.id}" - VPC = "foo" - - depends_on = ["aws_instance.web"] -} - -output "web_ip" { - value = "${aws_instance.web.private_ip}" -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl deleted file mode 100644 index 0007aaf5f..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl +++ /dev/null @@ -1 +0,0 @@ -foo.bar = "baz" diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl deleted file mode 100644 index 059d4ce65..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl +++ /dev/null @@ -1 +0,0 @@ -foo = [1, 2, "foo"] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl deleted file mode 100644 index 50f4218ac..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl +++ /dev/null @@ -1 +0,0 @@ -foo = [1, 2, "foo",] diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl deleted file mode 100644 index 029c54b0c..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -key = 7 diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl deleted file mode 100644 index e9f77cae9..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl +++ /dev/null @@ -1,3 +0,0 @@ -default = { - "eu-west-1": "ami-b1cf19c6", -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl deleted file mode 100644 index 92592fbb3..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl +++ /dev/null @@ -1,5 +0,0 @@ -// This is a test structure for the lexer -foo bar "baz" { - key = 7 - foo = "bar" -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl deleted file mode 100644 index 7229a1f01..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl +++ /dev/null @@ -1,5 +0,0 @@ -foo { - value = 7 - "value" = 8 - "complex::value" = 9 -} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl deleted file mode 100644 index 4d156ddea..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl +++ /dev/null @@ -1 +0,0 @@ -resource "foo" "bar" {} diff --git a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl b/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl deleted file mode 100644 index cf2747ea1..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl +++ /dev/null @@ -1,7 +0,0 @@ -foo = "bar" -bar = 7 -baz = [1,2,3] -foo = -12 -bar = 3.14159 -foo = true -bar = false diff --git a/vendor/github.com/hashicorp/hcl/hcl/token/token_test.go b/vendor/github.com/hashicorp/hcl/hcl/token/token_test.go deleted file mode 100644 index e4b4af25b..000000000 --- a/vendor/github.com/hashicorp/hcl/hcl/token/token_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package token - -import ( - "reflect" - "testing" -) - -func TestTypeString(t *testing.T) { - var tokens = []struct { - tt Type - str string - }{ - {ILLEGAL, "ILLEGAL"}, - {EOF, "EOF"}, - {COMMENT, "COMMENT"}, - {IDENT, "IDENT"}, - {NUMBER, "NUMBER"}, - {FLOAT, "FLOAT"}, - {BOOL, "BOOL"}, - {STRING, "STRING"}, - {HEREDOC, "HEREDOC"}, - {LBRACK, "LBRACK"}, - {LBRACE, "LBRACE"}, - {COMMA, "COMMA"}, - {PERIOD, "PERIOD"}, - {RBRACK, "RBRACK"}, - {RBRACE, "RBRACE"}, - {ASSIGN, "ASSIGN"}, - {ADD, "ADD"}, - {SUB, "SUB"}, - } - - for _, token := range tokens { - if token.tt.String() != token.str { - t.Errorf("want: %q got:%q\n", token.str, token.tt) - } - } - -} - -func TestTokenValue(t *testing.T) { - var tokens = []struct { - tt Token - v interface{} - }{ - {Token{Type: BOOL, Text: `true`}, true}, - {Token{Type: BOOL, Text: `false`}, false}, - {Token{Type: FLOAT, Text: `3.14`}, float64(3.14)}, - {Token{Type: NUMBER, Text: `42`}, int64(42)}, - {Token{Type: IDENT, Text: `foo`}, "foo"}, - {Token{Type: STRING, Text: `"foo"`}, "foo"}, - {Token{Type: STRING, Text: `"foo\nbar"`}, "foo\nbar"}, - {Token{Type: STRING, Text: `"${file("foo")}"`}, `${file("foo")}`}, - { - Token{ - Type: STRING, - Text: `"${replace("foo", ".", "\\.")}"`, - }, - `${replace("foo", ".", "\\.")}`}, - {Token{Type: HEREDOC, Text: "< 0 for %q", s.ErrorCount, src) - } -} - -func testTokenList(t *testing.T, tokenList []tokenPair) { - // create artifical source code - buf := new(bytes.Buffer) - for _, ident := range tokenList { - fmt.Fprintf(buf, "%s\n", ident.text) - } - - s := New(buf.Bytes()) - for _, ident := range tokenList { - tok := s.Scan() - if tok.Type != ident.tok { - t.Errorf("tok = %q want %q for %q\n", tok, ident.tok, ident.text) - } - - if tok.Text != ident.text { - t.Errorf("text = %q want %q", tok.String(), ident.text) - } - - } -} - -func countNewlines(s string) int { - n := 0 - for _, ch := range s { - if ch == '\n' { - n++ - } - } - return n -} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/array.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/array.json deleted file mode 100644 index e320f17ab..000000000 --- a/vendor/github.com/hashicorp/hcl/json/test-fixtures/array.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": [1, 2, "bar"], - "bar": "baz" -} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/basic.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/basic.json deleted file mode 100644 index b54bde96c..000000000 --- a/vendor/github.com/hashicorp/hcl/json/test-fixtures/basic.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo": "bar" -} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/object.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/object.json deleted file mode 100644 index 72168a3cc..000000000 --- a/vendor/github.com/hashicorp/hcl/json/test-fixtures/object.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "foo": { - "bar": [1,2] - } -} diff --git a/vendor/github.com/hashicorp/hcl/json/test-fixtures/types.json b/vendor/github.com/hashicorp/hcl/json/test-fixtures/types.json deleted file mode 100644 index 9a142a6ca..000000000 --- a/vendor/github.com/hashicorp/hcl/json/test-fixtures/types.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "foo": "bar", - "bar": 7, - "baz": [1,2,3], - "foo": -12, - "bar": 3.14159, - "foo": true, - "bar": false, - "foo": null -} diff --git a/vendor/github.com/hashicorp/hcl/json/token/token_test.go b/vendor/github.com/hashicorp/hcl/json/token/token_test.go deleted file mode 100644 index a83fdd55b..000000000 --- a/vendor/github.com/hashicorp/hcl/json/token/token_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package token - -import ( - "testing" -) - -func TestTypeString(t *testing.T) { - var tokens = []struct { - tt Type - str string - }{ - {ILLEGAL, "ILLEGAL"}, - {EOF, "EOF"}, - {NUMBER, "NUMBER"}, - {FLOAT, "FLOAT"}, - {BOOL, "BOOL"}, - {STRING, "STRING"}, - {NULL, "NULL"}, - {LBRACK, "LBRACK"}, - {LBRACE, "LBRACE"}, - {COMMA, "COMMA"}, - {PERIOD, "PERIOD"}, - {RBRACK, "RBRACK"}, - {RBRACE, "RBRACE"}, - } - - for _, token := range tokens { - if token.tt.String() != token.str { - t.Errorf("want: %q got:%q\n", token.str, token.tt) - - } - } - -} diff --git a/vendor/github.com/hashicorp/hcl/lex_test.go b/vendor/github.com/hashicorp/hcl/lex_test.go deleted file mode 100644 index 806276444..000000000 --- a/vendor/github.com/hashicorp/hcl/lex_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package hcl - -import ( - "testing" -) - -func TestLexMode(t *testing.T) { - cases := []struct { - Input string - Mode lexModeValue - }{ - { - "", - lexModeHcl, - }, - { - "foo", - lexModeHcl, - }, - { - "{}", - lexModeJson, - }, - { - " {}", - lexModeJson, - }, - } - - for i, tc := range cases { - actual := lexMode([]byte(tc.Input)) - - if actual != tc.Mode { - t.Fatalf("%d: %#v", i, actual) - } - } -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl deleted file mode 100644 index dd3151cb7..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl +++ /dev/null @@ -1,5 +0,0 @@ -resource = [{ - foo = [{ - bar = {} - }] -}] diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/basic.hcl deleted file mode 100644 index 949994487..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/basic.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -bar = "${file("bing/bong.txt")}" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic.json b/vendor/github.com/hashicorp/hcl/test-fixtures/basic.json deleted file mode 100644 index 7bdddc84b..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/basic.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": "bar", - "bar": "${file(\"bing/bong.txt\")}" -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl deleted file mode 100644 index 4e415da20..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl +++ /dev/null @@ -1 +0,0 @@ -count = "3" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl deleted file mode 100644 index 363697b49..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl +++ /dev/null @@ -1,3 +0,0 @@ -foo="bar" -bar="${file("bing/bong.txt")}" -foo-bar="baz" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl deleted file mode 100644 index ee8b06fe3..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl +++ /dev/null @@ -1,2 +0,0 @@ -environment = "aws" { -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl deleted file mode 100644 index 5b185cc91..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl +++ /dev/null @@ -1,15 +0,0 @@ -key "" { - policy = "read" -} - -key "foo/" { - policy = "write" -} - -key "foo/bar/" { - policy = "read" -} - -key "foo/bar/baz" { - policy = "deny" -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.json b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.json deleted file mode 100644 index 151864ee8..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_policy.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "key": { - "": { - "policy": "read" - }, - - "foo/": { - "policy": "write" - }, - - "foo/bar/": { - "policy": "read" - }, - - "foo/bar/baz": { - "policy": "deny" - } - } -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl deleted file mode 100644 index 52dcaa1bc..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl +++ /dev/null @@ -1,10 +0,0 @@ -variable "foo" { - default = "bar" - description = "bar" -} - -variable "amis" { - default = { - east = "foo" - } -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json b/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json deleted file mode 100644 index 49f921ed0..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "variable": { - "foo": { - "default": "bar", - "description": "bar" - }, - - "amis": { - "default": { - "east": "foo" - } - } - } -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/empty.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/empty.hcl deleted file mode 100644 index 5be1b2315..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/empty.hcl +++ /dev/null @@ -1 +0,0 @@ -resource "foo" {} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/escape.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/escape.hcl deleted file mode 100644 index f818b15e0..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/escape.hcl +++ /dev/null @@ -1,6 +0,0 @@ -foo = "bar\"baz\\n" -bar = "new\nline" -qux = "back\\slash" -qax = "slash\\:colon" -nested = "${HH\\:mm\\:ss}" -nestedquotes = "${"\"stringwrappedinquotes\""}" diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl deleted file mode 100644 index bc337fb7c..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl +++ /dev/null @@ -1,5 +0,0 @@ -output { - one = "${replace(var.sub_domain, ".", "\\.")}" - two = "${replace(var.sub_domain, ".", "\\\\.")}" - many = "${replace(var.sub_domain, ".", "\\\\\\\\.")}" -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/flat.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/flat.hcl deleted file mode 100644 index 9bca551f8..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/flat.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -Key = 7 diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/float.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/float.hcl deleted file mode 100644 index edf355e38..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/float.hcl +++ /dev/null @@ -1,2 +0,0 @@ -a = 1.02 -b = 2 diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/float.json b/vendor/github.com/hashicorp/hcl/test-fixtures/float.json deleted file mode 100644 index 580868043..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/float.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "a": 1.02, - "b": 2 -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl deleted file mode 100644 index f691948e1..000000000 Binary files a/vendor/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl and /dev/null differ diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/interpolate.json b/vendor/github.com/hashicorp/hcl/test-fixtures/interpolate.json deleted file mode 100644 index cad015198..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/interpolate.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "default": "${replace(\"europe-west\", \"-\", \" \")}" -} diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl deleted file mode 100644 index 8af345849..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = [["foo"], ["bar"]] - diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl deleted file mode 100644 index 985a33bae..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl +++ /dev/null @@ -1,4 +0,0 @@ -foo = [ - {somekey1 = "someval1"}, - {somekey2 = "someval2", someextrakey = "someextraval"}, -] diff --git a/vendor/github.com/hashicorp/hcl/test-fixtures/multiline.hcl b/vendor/github.com/hashicorp/hcl/test-fixtures/multiline.hcl deleted file mode 100644 index f883bd707..000000000 --- a/vendor/github.com/hashicorp/hcl/test-fixtures/multiline.hcl +++ /dev/null @@ -1,4 +0,0 @@ -foo = <