MCPcopy Create free account
hub / github.com/rilldata/rill / TestStrToTimePtr

Function TestStrToTimePtr

runtime/pkg/mapstructureutil/mapstructureutil_test.go:19–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17}
18
19func TestStrToTimePtr(t *testing.T) {
20 in := map[string]any{}
21 out := struct{ Val *time.Time }{}
22 err := WeakDecode(in, &out)
23 require.NoError(t, err)
24 require.Nil(t, out.Val)
25
26 ts := time.Now()
27 in["Val"] = ts.Format(time.RFC3339Nano)
28 err = WeakDecode(in, &out)
29 require.NoError(t, err)
30 require.True(t, ts.Equal(*out.Val))
31}
32
33func TestWeakDecodeWithWarnings(t *testing.T) {
34 type target struct {

Callers

nothing calls this directly

Calls 2

WeakDecodeFunction · 0.85
FormatMethod · 0.65

Tested by

no test coverage detected