(t *testing.T)
| 17 | } |
| 18 | |
| 19 | func 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 | |
| 33 | func TestWeakDecodeWithWarnings(t *testing.T) { |
| 34 | type target struct { |
nothing calls this directly
no test coverage detected