summaryrefslogtreecommitdiffstats
path: root/devices
diff options
context:
space:
mode:
Diffstat (limited to 'devices')
-rw-r--r--devices/temp_darwin_test.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/devices/temp_darwin_test.go b/devices/temp_darwin_test.go
index a7389bd..0301260 100644
--- a/devices/temp_darwin_test.go
+++ b/devices/temp_darwin_test.go
@@ -1,3 +1,4 @@
+//go:build darwin
// +build darwin
package devices
@@ -5,13 +6,18 @@ package devices
import (
"bytes"
"encoding/csv"
+ "io"
+ "log"
"testing"
)
func Test_NumCols(t *testing.T) {
parser := csv.NewReader(bytes.NewReader(smcData))
parser.Comma = '\t'
- var line []string
+ var (
+ line []string
+ err error
+ )
for {
if line, err = parser.Read(); err == io.EOF {
break
@@ -23,7 +29,7 @@ func Test_NumCols(t *testing.T) {
// The line is malformed if len(line) != 2, but because the asset is static
// it makes no sense to report the error to downstream users. This must be
// tested at/around compile time.
- if len(line) == 2 {
+ if len(line) != 2 {
t.Errorf("smc CSV data malformed: expected 2 columns, got %d", len(line))
}
}