+
+func TestGeneratedParseTimestamp(t *testing.T) {
+ RegisterTestingT(t)
+
+ var data = []struct {
+ input time.Time
+ result vpe_types.Timestamp
+ }{
+ {time.Unix(0, 0), vpe_types.Timestamp(0)},
+ {time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC),
+ vpe_types.Timestamp(9.466848e+08)},
+ }
+
+ for _, entry := range data {
+ t.Run(entry.input.String(), func(t *testing.T) {
+ ts := vpe_types.NewTimestamp(entry.input)
+ Expect(ts).To(Equal(entry.result))
+
+ Expect(entry.input.Equal(ts.ToTime())).To(BeTrue())
+
+ originTime := ts.String()
+ Expect(originTime).To(Equal(entry.input.Local().String()))
+ })
+ }
+}