Delete functions that no product code calls, and fold "simple plus WithOptions" pairs into the one signature callers actually use. Rename the live macOS lifecycle functions that were labelled Legacy. The architecture tests now share one source loader and reject functions without a product caller and catalog messages nobody reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
970 B
Go
27 lines
970 B
Go
package host
|
|
|
|
import "testing"
|
|
|
|
func TestParseCtlLine(t *testing.T) {
|
|
// Formats from reims_util.rs:480-488 and its test at :777-786.
|
|
u, _ := ParseCtlLine("downloading the macOS Tahoe 26 recovery image: 45% of 2.0 GB")
|
|
if u.Kind != KindProgress || u.Step != "downloading the macOS Tahoe 26 recovery image" || u.Percent != 45 || u.Total != 2_000_000_000 {
|
|
t.Fatalf("percent line = %+v", u)
|
|
}
|
|
u, _ = ParseCtlLine("macos-tahoe: downloading OpenCore 1.0.8: 5% of 11 MB")
|
|
if u.Step != "macos-tahoe: downloading OpenCore 1.0.8" || u.Total != 11_000_000 {
|
|
t.Fatalf("ctl-prefixed line = %+v", u)
|
|
}
|
|
u, _ = ParseCtlLine("downloading the installer: 300 MB")
|
|
if u.Kind != KindProgress || u.Percent != -1 || u.Done != 300_000_000 {
|
|
t.Fatalf("size line = %+v", u)
|
|
}
|
|
u, _ = ParseCtlLine("creating the disk")
|
|
if u.Kind != KindNote || u.Message != "creating the disk" {
|
|
t.Fatalf("note = %+v", u)
|
|
}
|
|
if _, ok := ParseCtlLine(" "); ok {
|
|
t.Fatal("blank line")
|
|
}
|
|
}
|