cmd/go, testing: consider shrinking set of characters allowed/passed through in subtest names #73116
Labels
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
This issue is meant to capture a small finding from #73086, and it's related to the cluster of proposals like #67562 (and its earlier version #45549), #27896, possibly more like #44970, #20209, #20210, #20115, and so on. Also #60977. It's not a proposal in its current form as that needs a more holistic analysis.
Right now there are some characters permitted to be used in subtest names that might cause problems for other systems that need to process
go test -json
output, including the Unicode replacement character U+FFFD:(playground link: https://go.dev/play/p/unQcgsua0J3)
Also potentially worth considering are subtest names that use different Unicode normalization, which the current basic rewriting of equal subtest names doesn't catch: https://go.dev/play/p/xut7W4Cp4p_g.
Said programs can (and do) deal with this by escaping on their end, but this issue is to investigate whether a future version of the go command can do better, perhaps by disallowing or rewriting subtest names.
Note that a subtest name is often used in combination with other parts needed to uniquely identify a test, which have corresponding existing constraints:
CC @matloob, @samthanawalla.
The text was updated successfully, but these errors were encountered: