From 5fa2e8405aa9d20c691bd29a9fae22db1e312457 Mon Sep 17 00:00:00 2001 From: DN2 Date: Thu, 10 Jan 2019 01:35:39 -0800 Subject: [PATCH] make the test smaller, because why not. --- integrations/influxunifi/unidev/unidev_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/integrations/influxunifi/unidev/unidev_test.go b/integrations/influxunifi/unidev/unidev_test.go index e69a4ffd..ed6cf005 100644 --- a/integrations/influxunifi/unidev/unidev_test.go +++ b/integrations/influxunifi/unidev/unidev_test.go @@ -10,17 +10,15 @@ import ( func TestFlexInt(t *testing.T) { t.Parallel() a := assert.New(t) - five := []byte(`{"channel": "5"}`) - seven := []byte(`{"channel": 7}`) - auto := []byte(`{"channel": "auto"}`) type reply struct { Channel FlexInt `json:"channel"` } var r reply - a.Nil(json.Unmarshal(five, &r)) + a.Nil(json.Unmarshal([]byte(`{"channel": "5"}`), &r)) a.EqualValues(FlexInt(5), r.Channel) - a.Nil(json.Unmarshal(seven, &r)) + a.Nil(json.Unmarshal([]byte(`{"channel": 7}`), &r)) a.EqualValues(FlexInt(7), r.Channel) - a.Nil(json.Unmarshal(auto, &r), "a regular string must not produce an unmarshal error") + a.Nil(json.Unmarshal([]byte(`{"channel": "auto"}`), &r), + "a regular string must not produce an unmarshal error") a.EqualValues(FlexInt(0), r.Channel) }