internal/agent/hostinfo/hostinfo_darwin_test.go
Ref: Size: 694 B History
//go:build darwin
package hostinfo
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
)
// This file never runs in CI — there is no Mac runner. It exists so that
// `go test ./...` on a Mac checks the two Darwin answers that are decisions
// rather than readings. Everything else Darwin does is a sysctl call whose
// parsing is covered by the untagged fixture tests.
func TestVirtIsNoneOnDarwin(t *testing.T) {
assert.Equal(t, "none", virtSource(context.Background(), nil))
}
func TestOSIdentityReadsTheSystemPlist(t *testing.T) {
id, pretty, version := osIdentity()
assert.Equal(t, "macos", id)
assert.Contains(t, pretty, "macOS")
assert.NotEmpty(t, version)
}