Skip to content

Commit

Permalink
types: migrate TestConvertTimeZone to testify (pingcap#28010)
Browse files Browse the repository at this point in the history
Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
  • Loading branch information
karuppiah7890 committed Sep 16, 2021
1 parent c2bf3f1 commit 171cf12
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions types/time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,8 @@ func TestDateFSP(t *testing.T) {
}
}

func (s *testTimeSuite) TestConvertTimeZone(c *C) {
func TestConvertTimeZone(t *testing.T) {
t.Parallel()
loc, _ := time.LoadLocation("Asia/Shanghai")
tests := []struct {
input types.CoreTime
Expand All @@ -1146,10 +1147,10 @@ func (s *testTimeSuite) TestConvertTimeZone(c *C) {
}

for _, test := range tests {
t := types.NewTime(test.input, 0, 0)
err := t.ConvertTimeZone(test.from, test.to)
c.Assert(err, IsNil)
c.Assert(t.Compare(types.NewTime(test.expect, 0, 0)), Equals, 0)
v := types.NewTime(test.input, 0, 0)
err := v.ConvertTimeZone(test.from, test.to)
require.NoError(t, err)
require.Equal(t, 0, v.Compare(types.NewTime(test.expect, 0, 0)))
}
}

Expand Down

0 comments on commit 171cf12

Please sign in to comment.