Skip to content

Commit 1763cea

Browse files
committed
internal/tdtest: mimic replacement of testing.Run in Select
This allows the select string to be the same as the subtest name. This is only an approximation, as testing.T.Run does more rewriting. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I36290242264d831b788fe9a5975210f5c1e4ba41 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1167817 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 220b44e commit 1763cea

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

internal/tdtest/tdtest.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ import (
4040
// - make name field explicit, i.e. Name("name"), field tag, or tdtest.Name type.
4141
// - allow "skip" field. Again either SkipName("skip"), tag, or Skip type.
4242
// - allow for tdtest:"noupdate" field tag.
43-
// - should we derive names from field names? This would require always
44-
// loading the packages data upon error. Could be an option to disable, or
45-
// implicitly it would only be loaded if there is an error without message.
4643
// - Option: allow ignore field that lists a set of fields to not be tested
4744
// for that particular test case: ignore: tdtest.Ignore("want1", "want2")
4845
//
@@ -165,6 +162,7 @@ func (t *T) Select(tests ...any) {
165162
return
166163
}
167164
case string:
165+
n = strings.ReplaceAll(n, " ", "_")
168166
if n == parts[len(parts)-1] {
169167
return
170168
}

0 commit comments

Comments
 (0)