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 {