Skip to content

Commit

Permalink
types: migrate TestTruncateFrac 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 a613bf8 commit 9c1666e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions types/time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,8 @@ func TestTimeOverflow(t *testing.T) {
}
}

func (s *testTimeSuite) TestTruncateFrac(c *C) {
func TestTruncateFrac(t *testing.T) {
t.Parallel()
cols := []struct {
input time.Time
fsp int8
Expand All @@ -1836,10 +1837,11 @@ func (s *testTimeSuite) TestTruncateFrac(c *C) {

for _, col := range cols {
res, err := types.TruncateFrac(col.input, col.fsp)
c.Assert(res.Second(), Equals, col.output.Second())
c.Assert(err, IsNil)
require.Equal(t, col.output.Second(), res.Second())
require.NoError(t, err)
}
}

func (s *testTimeSuite) TestTimeSub(c *C) {
tbl := []struct {
Arg1 string
Expand Down

0 comments on commit 9c1666e

Please sign in to comment.