Skip to content

Commit

Permalink
types: migrate TestInvalidZero 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 18d212c commit 9e03158
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions types/time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1477,13 +1477,14 @@ func TestCurrentTime(t *testing.T) {
require.Equal(t, int8(0), res.Fsp())
}

func (s *testTimeSuite) TestInvalidZero(c *C) {
func TestInvalidZero(t *testing.T) {
t.Parallel()
in := types.NewTime(types.ZeroCoreTime, mysql.TypeTimestamp, types.DefaultFsp)
c.Assert(in.InvalidZero(), Equals, true)
require.True(t, in.InvalidZero())
in.SetCoreTime(types.FromDate(2019, 00, 00, 00, 00, 00, 00))
c.Assert(in.InvalidZero(), Equals, true)
require.True(t, in.InvalidZero())
in.SetCoreTime(types.FromDate(2019, 04, 12, 12, 00, 00, 00))
c.Assert(in.InvalidZero(), Equals, false)
require.False(t, in.InvalidZero())
}

func (s *testTimeSuite) TestGetFsp(c *C) {
Expand Down

0 comments on commit 9e03158

Please sign in to comment.