fix(suite): Add hyphen support for context keys (#1277)

This commit is contained in:
TwiN
2025-09-19 12:09:18 -04:00
committed by GitHub
parent 3a95e32210
commit 1658825525
3 changed files with 139 additions and 5 deletions

View File

@@ -391,7 +391,7 @@ func replaceContextPlaceholders(input string, ctx *gontext.Gontext) (string, err
return input, nil
}
var contextErrors []string
contextRegex := regexp.MustCompile(`\[CONTEXT\]\.[\w\.]+`)
contextRegex := regexp.MustCompile(`\[CONTEXT\]\.[\w\.\-]+`)
result := contextRegex.ReplaceAllStringFunc(input, func(match string) string {
// Extract the path after [CONTEXT].
path := strings.TrimPrefix(match, "[CONTEXT].")