From c9e7ec3621b0b765645dcc1fd45079cfc70c7ea7 Mon Sep 17 00:00:00 2001 From: Fatih Arslan Date: Sun, 25 Oct 2015 21:18:46 +0300 Subject: [PATCH] printer: add list example --- printer/printer_test.go | 1 + printer/testdata/list.golden | 27 +++++++++++++++++++++++++++ printer/testdata/list.input | 21 +++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 printer/testdata/list.golden create mode 100644 printer/testdata/list.input diff --git a/printer/printer_test.go b/printer/printer_test.go index 208d390..1901121 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -25,6 +25,7 @@ type entry struct { // Use go test -update to create/update the respective golden files. var data = []entry{ {"complexhcl.input", "complexhcl.golden"}, + {"list.input", "list.golden"}, } func TestFiles(t *testing.T) { diff --git a/printer/testdata/list.golden b/printer/testdata/list.golden new file mode 100644 index 0000000..0b949f1 --- /dev/null +++ b/printer/testdata/list.golden @@ -0,0 +1,27 @@ +foo = ["fatih", "arslan"] + +foo = ["bar", "qaz"] + +foo = ["zeynep", + "arslan", +] + +foo = ["fatih", "zeynep", + "arslan", +] + +foo = [ + "vim-go", + "golang", + "hcl", +] + +foo = [] + +foo = [1, 2, 3, 4] + +foo = [ + "kenya", + "ethiopia", + "columbia", +] \ No newline at end of file diff --git a/printer/testdata/list.input b/printer/testdata/list.input new file mode 100644 index 0000000..dd68fdd --- /dev/null +++ b/printer/testdata/list.input @@ -0,0 +1,21 @@ +foo = ["fatih", "arslan" ] + +foo = [ "bar", "qaz", ] + +foo = [ "zeynep", +"arslan", ] + +foo = ["fatih", "zeynep", +"arslan", ] + +foo = [ + "vim-go", + "golang", "hcl"] + +foo = [] + +foo = [1, 2,3, 4] + +foo = [ + "kenya", "ethiopia", + "columbia"]