go/src/testing
Jonathan Amsterdam 3eaee3d5dd testing/slogtest: check for no group with empty record
As #61067 pointed out, slog did not properly handle empty groups.
https://go.dev/cl/508436 dealt with most cases inside slog itself,
but handlers must still do a check on their own. Namely, a handler
must not output a group created by WithGroup unless the Record
has attributes.

This change adds a test to slogtest to check that case.

Fixes #61227.

Change-Id: Ibc065b6e5f6e199a41bce8332ea8c7f9d8373392
Reviewed-on: https://go-review.googlesource.com/c/go/+/508438
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-07-11 20:08:28 +00:00
..
fstest testing/fstest: fix the Glob test when dir entries are out of order 2023-06-16 18:21:40 +00:00
internal/testdeps all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
iotest testing: use strings.Builder 2022-09-07 07:03:10 +00:00
quick database/sql,testing/quick: use reflect.Value.SetZero 2023-04-04 07:16:34 +00:00
slogtest testing/slogtest: check for no group with empty record 2023-07-11 20:08:28 +00:00
allocs.go
allocs_test.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
benchmark.go Revert "testing: only report subtest races once" 2023-05-24 17:35:45 +00:00
benchmark_test.go testing: add an example showcasing B.RunParallel with B.ReportMetric 2022-10-07 17:49:17 +00:00
cover.go cmd/go,testing: re-implement testing.Coverage 2023-05-23 11:37:31 +00:00
example.go std: fix various nilness findings 2023-04-20 01:07:29 +00:00
export_test.go
flag_test.go testing: quote -test.v=test2json output when logging it 2023-03-23 19:50:22 +00:00
fuzz.go all: fix typos in go file comments 2023-01-09 15:34:31 +00:00
helper_test.go cmd/go, testing: add go test -skip flag 2022-09-16 14:48:54 +00:00
helperfuncs_test.go cmd/compile: mark closures made for generic function expressions as wrappers 2022-05-26 21:06:31 +00:00
match.go cmd/go, testing: add go test -skip flag 2022-09-16 14:48:54 +00:00
match_test.go cmd/go, testing: add go test -skip flag 2022-09-16 14:48:54 +00:00
newcover.go cmd/go,testing: re-implement testing.Coverage 2023-05-23 11:37:31 +00:00
panic_test.go testing: in TestRacyOutput, ensure that the Run calls complete before cleanup 2022-11-16 17:22:19 +00:00
run_example.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
run_example_wasm.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
sub_test.go testing: in TestRacyOutput, ensure that the Run calls complete before cleanup 2022-11-16 17:22:19 +00:00
testing.go Revert "testing: only report subtest races once" 2023-05-24 17:35:45 +00:00
testing_other.go testing: include ERROR_SHARING_VIOLATION in Windows cleanup retries 2022-03-03 02:39:01 +00:00
testing_test.go Revert "testing: only report subtest races once" 2023-05-24 17:35:45 +00:00
testing_windows.go testing: include ERROR_SHARING_VIOLATION in Windows cleanup retries 2022-03-03 02:39:01 +00:00