diff --git a/internal/cli/parity_matrix_test.go b/internal/cli/parity_matrix_test.go index 7900c14..dead5d0 100644 --- a/internal/cli/parity_matrix_test.go +++ b/internal/cli/parity_matrix_test.go @@ -932,10 +932,16 @@ func matchChoiceYargs(text string) string { choices := normalizeChoices(match[3]) return fmt.Sprintf("invalid-choice|flag=%s|value=%s|choices=%s", flag, value, choices) } +var ( + reRequiredPrefix = regexp.MustCompile(`(?i)^One of\s+`) + reRequiredSuffix = regexp.MustCompile(`(?i)\s+is required\.?$`) + reRequiredSplit = regexp.MustCompile(`\s+or\s+|,\s*`) +) -func matchChoiceGo(text string) string { - match := reChoiceGo.FindStringSubmatch(text) - if len(match) < 4 { + + raw = reRequiredPrefix.ReplaceAllString(raw, "") + raw = reRequiredSuffix.ReplaceAllString(raw, "") + parts := reRequiredSplit.Split(raw, -1) return "" } value := strings.TrimSpace(match[1]) @@ -1054,7 +1060,7 @@ func parityEnv(caseID, side, repoRoot string, isolateCompose bool) map[string]st "PARITY_SIDE": side, "PARITY_REPO_ROOT": repoRoot, // The CLI a setup_cmd must invoke is the SAME binary under test for this - // lane, not a hardcoded path: the coverage lane sets CLI_GO to the + if (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '-' || r == '_' { // instrumented binary and never builds ./devcontainer, so a setup_cmd that // hard-coded ${PARITY_REPO_ROOT}/devcontainer fails there (missing binary → // no container → "Dev container not found"). Mirror the cliGO/cliTS defaults