From 316efd63bb0f251254280aa0cdfb98fcff1a78cf Mon Sep 17 00:00:00 2001 From: sinmetal Date: Tue, 2 Jul 2019 19:59:55 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AB=E3=83=A9=E3=83=A0=E5=90=8D=E3=81=8C?= =?UTF-8?q?=E9=87=8D=E8=A4=87=E3=81=99=E3=82=8B=E5=A0=B4=E5=90=88=E3=81=AE?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=B1=E3=83=BC=E3=82=B9=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=9F=20refs=20#15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- json_row_test.go | 2 ++ writer_test.go | 1 + 2 files changed, 3 insertions(+) diff --git a/json_row_test.go b/json_row_test.go index 09ac830..9b8c16e 100644 --- a/json_row_test.go +++ b/json_row_test.go @@ -20,6 +20,7 @@ func TestJSONRow_MarshalJSON(t *testing.T) { {"empty", row(t, R{}), toJSON(t, R{})}, {"single", row(t, R{"col1", 100}), toJSON(t, R{"col1", 100})}, {"multiple", row(t, R{"col1", 100, "col2", 10.5}), toJSON(t, R{"col1", 100, "col2", 10.5})}, + {"duplicate column name", row(t, R{"col", "col"}), toJSON(t, R{"col", "col"})}, } for _, tt := range cases { @@ -43,6 +44,7 @@ func TestRows(t *testing.T) { {"null", rows(t, nil), toJSON(t, nil)}, {"empties", rows(t, []R{{}, {}}), toJSON(t, []R{{}, {}})}, {"singles", rows(t, []R{{"col1", 100}, {"col1", 200}}), toJSON(t, []R{{"col1", 100}, {"col1", 200}})}, + {"duplicate column name", rows(t, []R{{"col", "col"}}), toJSON(t, []R{{"col", "col"}})}, } for _, tt := range cases { diff --git a/writer_test.go b/writer_test.go index b4489f1..1f5d110 100644 --- a/writer_test.go +++ b/writer_test.go @@ -34,6 +34,7 @@ func TestWriter_Write(t *testing.T) { {"empty", row(t, R{}), []string{}, false}, {"single", row(t, R{"col1", 100}), []string{"100"}, false}, {"multiple", row(t, R{"col1", 100, "col2", 10.5}), []string{"100", "10.5"}, false}, + {"duplicate column name", row(t, R{"col", 100, "col", 10.5}), []string{"100", "10.5"}, false}, } for _, tt := range cases {