25 lines
480 B
Go
25 lines
480 B
Go
//go:build windows
|
|
|
|
package host
|
|
|
|
import "testing"
|
|
|
|
func TestListDrivesFindsTheSystemDrive(t *testing.T) {
|
|
var sys bool
|
|
for _, d := range ListDrives() {
|
|
t.Logf("%s free=%.0fGB system=%v external=%v", d.Root, d.FreeGB, d.System, d.External)
|
|
if d.System {
|
|
sys = true
|
|
if d.External {
|
|
t.Error("system drive reported as USB")
|
|
}
|
|
if d.VolumeGUID == "" {
|
|
t.Error("system drive has no volume GUID")
|
|
}
|
|
}
|
|
}
|
|
if !sys {
|
|
t.Fatal("no system drive listed")
|
|
}
|
|
}
|