summaryrefslogtreecommitdiffstats
path: root/devices
diff options
context:
space:
mode:
authorQuan Tong <quantonganh@gmail.com>2022-03-26 15:08:44 +0700
committerQuan Tong <quantonganh@gmail.com>2022-03-26 15:08:44 +0700
commite0165a228378dad026353736f433269307b88190 (patch)
tree7edc1ab6aec5d2a8bde954f58ffe720585d98064 /devices
parent6daf6932469ecf60689843953bbcbe93a9879156 (diff)
Fixes test on darwin
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))
}
}