Skip to content

Commit

Permalink
feat: improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sranka committed Nov 29, 2023
1 parent e9166da commit 425a783
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions api/data_to_point_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 425a783

Please sign in to comment.