mirror of
https://github.com/sstent/go-garth.git
synced 2026-01-26 09:03:00 +00:00
sync - build broken
This commit is contained in:
21
python-garmin-connect/Time_test.go
Normal file
21
python-garmin-connect/Time_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package connect
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTimeUnmarshalJSON(t *testing.T) {
|
||||
var t0 Time
|
||||
|
||||
input := []byte(`"2019-01-12T11:45:23.0"`)
|
||||
|
||||
err := json.Unmarshal(input, &t0)
|
||||
if err != nil {
|
||||
t.Fatalf("Error parsing %s: %s", string(input), err.Error())
|
||||
}
|
||||
|
||||
if t0.String() != "2019-01-12 11:45:23 +0000 UTC" {
|
||||
t.Errorf("Failed to parse `%s` correct, got %s", string(input), t0.String())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user