From 425a78382c48a2e5784ed939d9f9be76541f5c52 Mon Sep 17 00:00:00 2001 From: Pavel Zavora Date: Wed, 29 Nov 2023 13:06:57 +0100 Subject: [PATCH] feat: improve tests --- api/data_to_point_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/api/data_to_point_test.go b/api/data_to_point_test.go index 4c842bc..d78317d 100644 --- a/api/data_to_point_test.go +++ b/api/data_to_point_test.go @@ -200,6 +200,28 @@ func TestDataToPoint(t *testing.T) { }, error: `cannot use map[string]interface {} as point`, }, + { + name: "test unsupported field type", + s: &struct { + Measurement string `lp:"measurement"` + Temp complex64 `lp:"field,a"` + }{ + "air", + complex(1, 1), + }, + error: `cannot use field 'Temp' of type 'complex64' as to create a point`, + }, + { + name: "test unsupported lp tag value", + s: &struct { + Measurement string `lp:"measurement"` + Temp float64 `lp:"data,a"` + }{ + "air", + 1.0, + }, + error: `invalid tag data`, + }, } for _, ts := range tests { t.Run(ts.name, func(t *testing.T) {