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
iotest
quick
slogtest testing/slogtest: check for no group with empty record 2023-07-11 20:08:28 +00:00
allocs.go
allocs_test.go
benchmark.go Revert "testing: only report subtest races once" 2023-05-24 17:35:45 +00:00
benchmark_test.go
cover.go cmd/go,testing: re-implement testing.Coverage 2023-05-23 11:37:31 +00:00
example.go
export_test.go
flag_test.go
fuzz.go
helper_test.go
helperfuncs_test.go
match.go
match_test.go
newcover.go cmd/go,testing: re-implement testing.Coverage 2023-05-23 11:37:31 +00:00
panic_test.go
run_example.go
run_example_wasm.go
sub_test.go
testing.go Revert "testing: only report subtest races once" 2023-05-24 17:35:45 +00:00
testing_other.go
testing_test.go Revert "testing: only report subtest races once" 2023-05-24 17:35:45 +00:00
testing_windows.go