mirror of
https://github.com/tailscale/tailscale.git
synced 2024-12-01 22:15:51 +00:00
3ac731dda1
This was meant to be part of 47045265b9
which instead deleted them :(
Updates tailscale/corp#1959
30 lines
549 B
Go
30 lines
549 B
Go
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package hostinfo
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
)
|
|
|
|
func TestNew(t *testing.T) {
|
|
hi := New()
|
|
if hi == nil {
|
|
t.Fatal("no Hostinfo")
|
|
}
|
|
j, err := json.MarshalIndent(hi, " ", "")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Logf("Got: %s", j)
|
|
}
|
|
|
|
func TestOSVersion(t *testing.T) {
|
|
if osVersion == nil {
|
|
t.Skip("not available for OS")
|
|
}
|
|
t.Logf("Got: %#q", osVersion())
|
|
}
|