testing: unclear if T.Name includes sub-tests as part of its string #46488
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
The current docs say:
For a
func TestFoo(t *testing.T)
, I think it's reasonably clear that Name will beTestFoo
.However, for a sub-test like
t.Run("Bar", ...)
, it's not clear from the documentation if Name will returnTestFoo/Bar
or justTestFoo
.Another open question is whether the name will be altered, just like it is when printing output. For example,
t.Run("bar baz", ...)
ends up printingTestFoo/bar_baz
in the terminal, so if the subtest name is included in the Name method, I'm not sure which of the two I'd expect.cc @mpvl as per the owners doc
cc @adg @bradfitz since they added the Name method
The text was updated successfully, but these errors were encountered: