1
0
mirror of https://github.com/golang/go synced 2024-11-26 21:31:32 -07:00

log/slog: add missing test in value_test.go

This commit is contained in:
pgxiaolianzi 2024-01-26 20:59:13 +08:00 committed by GitHub
parent d278d5bbdd
commit 6adb9f6f31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,9 +30,16 @@ func TestValueEqual(t *testing.T) {
BoolValue(true), BoolValue(true),
BoolValue(false), BoolValue(false),
TimeValue(testTime), TimeValue(testTime),
TimeValue(time.Date(2001, 1, 2, 3, 4, 5, 0, time.UTC)),
AnyValue(&x), AnyValue(&x),
AnyValue(&y), AnyValue(&y),
GroupValue(Bool("b", true), Int("i", 3)), GroupValue(Bool("b", true), Int("i", 3)),
GroupValue(Bool("b", true), Int("i", 4)),
GroupValue(Bool("b", true), Int("j", 4)),
DurationValue(3 * time.Second),
DurationValue(2 * time.Second),
StringValue("foo"),
StringValue("fuu"),
} }
for i, v1 := range vals { for i, v1 := range vals {
for j, v2 := range vals { for j, v2 := range vals {
@ -164,6 +171,7 @@ func TestValueAny(t *testing.T) {
time.Minute, time.Minute,
time.Time{}, time.Time{},
3.14, 3.14,
"foo",
} { } {
v := AnyValue(want) v := AnyValue(want)
got := v.Any() got := v.Any()