Skip to content

Commit deab307

Browse files
rogpeppemvdan
authored andcommitted
internal/tdtest: document how the name field is used
This detail wasn't clear from the doc comments. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I92f70df872244e6379692ddb756dbde1bd26ecd9 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1170245 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 4d2ba88 commit deab307

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/tdtest/tdtest.go

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ type set[TC any] struct {
6262
}
6363

6464
// Run runs the given function for each (selected) element in the table.
65+
// TC must be a struct type. If that has a string field named "name",
66+
// that value will be used to name the associated subtest.
6567
func Run[TC any](t *testing.T, table []TC, fn func(t *T, tc *TC)) {
6668
s := &set[TC]{
6769
t: t,

0 commit comments

Comments
 (0)