Move Prep, recovery markers, offline helper and OpenCore language handling into internal/macos/startprep while retaining memory, affinity and line-writer helpers in vmstart. Remove the host-to-macOS vmstart architecture exception and preserve preparation and commit-memory tests on both sides.
32 lines
1.2 KiB
Go
32 lines
1.2 KiB
Go
package startprep
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/Nwflower/reims-go/internal/config"
|
|
"github.com/Nwflower/reims-go/internal/host"
|
|
"github.com/Nwflower/reims-go/internal/i18n"
|
|
)
|
|
|
|
func TestCheckWHPX(t *testing.T) {
|
|
pZh := &Prep{cfg: config.Config{Locale: i18n.ZhCN}}
|
|
pEn := &Prep{cfg: config.Config{Locale: i18n.EnUS}}
|
|
|
|
if err := pZh.CheckWHPX(host.Report{WHPX: host.WHPXReady}); err != nil {
|
|
t.Fatalf("WHPXReady should pass, got %v", err)
|
|
}
|
|
if err := pZh.CheckWHPX(host.Report{WHPX: host.WHPXNoHypervisor}); err == nil || !strings.Contains(err.Error(), "hypervisorlaunchtype") {
|
|
t.Fatalf("WHPXNoHypervisor (zh-CN) = %v", err)
|
|
}
|
|
if err := pEn.CheckWHPX(host.Report{WHPX: host.WHPXNoHypervisor}); err == nil || !strings.Contains(err.Error(), "unrelated to disk space") {
|
|
t.Fatalf("WHPXNoHypervisor (en-US) = %v", err)
|
|
}
|
|
if err := pZh.CheckWHPX(host.Report{WHPX: host.WHPXMissing}); err == nil || !strings.Contains(err.Error(), "WHPX") {
|
|
t.Fatalf("WHPXMissing (zh-CN) = %v", err)
|
|
}
|
|
if err := pEn.CheckWHPX(host.Report{WHPX: host.WHPXUnsupported}); err == nil || !strings.Contains(err.Error(), "1803") {
|
|
t.Fatalf("WHPXUnsupported (en-US) = %v", err)
|
|
}
|
|
}
|