add legacy mode and some cleanup

This commit is contained in:
KingKDot
2026-08-20 09:01:27 -05:00
parent 3b6adf7b97
commit a9b7ca67ea
14 changed files with 257 additions and 100 deletions
@@ -17,14 +17,19 @@ func TestGeneratedWireContract(t *testing.T) {
if !ok {
t.Fatalf("missing version range for %s", command)
}
if versionRange.Min != 1 || versionRange.Max != 1 {
wantMax := 1
switch command {
case CommandBackstageStartBrowserInjected, CommandBackstageStartChromeInjected, CommandBackstageStartProcessInjected:
wantMax = 2
}
if versionRange.Min != 1 || versionRange.Max != wantMax {
t.Fatalf("unexpected version range for %s: %+v", command, versionRange)
}
if !IsSupportedCommandVersion(string(command), 1) {
t.Fatalf("%s must support v1", command)
}
if IsSupportedCommandVersion(string(command), 2) {
t.Fatalf("%s must not support undeclared v2", command)
if IsSupportedCommandVersion(string(command), 2) != (wantMax == 2) {
t.Fatalf("unexpected v2 support for %s", command)
}
}
if !IsCommandType("desktop_start") {