Skip to content

Commit 702d609

Browse files
lxl-renrengopherbot
authored andcommitted
log/slog: add missing test in value_test.go
TestValueEqual: Added test cases for DurationValue, StringValue, and TimeValue types. TestValueAny: Added a test case for string values. Change-Id: I74ef15bcfcacd0bf5d990debd24846283edf1ecd GitHub-Last-Rev: 6adb9f6 GitHub-Pull-Request: #65303 Reviewed-on: https://go-review.googlesource.com/c/go/+/558755 Reviewed-by: Jonathan Amsterdam <[email protected]> Auto-Submit: Jonathan Amsterdam <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 7e91cfb commit 702d609

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/log/slog/value_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,16 @@ func TestValueEqual(t *testing.T) {
3030
BoolValue(true),
3131
BoolValue(false),
3232
TimeValue(testTime),
33+
TimeValue(time.Date(2001, 1, 2, 3, 4, 5, 0, time.UTC)),
3334
AnyValue(&x),
3435
AnyValue(&y),
3536
GroupValue(Bool("b", true), Int("i", 3)),
37+
GroupValue(Bool("b", true), Int("i", 4)),
38+
GroupValue(Bool("b", true), Int("j", 4)),
39+
DurationValue(3 * time.Second),
40+
DurationValue(2 * time.Second),
41+
StringValue("foo"),
42+
StringValue("fuu"),
3643
}
3744
for i, v1 := range vals {
3845
for j, v2 := range vals {
@@ -164,6 +171,7 @@ func TestValueAny(t *testing.T) {
164171
time.Minute,
165172
time.Time{},
166173
3.14,
174+
"foo",
167175
} {
168176
v := AnyValue(want)
169177
got := v.Any()

0 commit comments

Comments
 (0)