Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleFall authored and ti-chi-bot committed Mar 1, 2023
1 parent d169611 commit 74dc563
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions types/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1288,4 +1288,12 @@ func TestConvertDecimalStrToUint(t *testing.T) {
}
require.Equal(t, ca.result, result, "input=%v", ca.input)
}

result, err := convertDecimalStrToUint(&stmtctx.StatementContext{}, "-99.0", math.MaxUint8, 0)
require.Error(t, err)
require.Equal(t, uint64(0), result)

result, err = convertDecimalStrToUint(&stmtctx.StatementContext{}, "-100.0", math.MaxUint8, 0)
require.Error(t, err)
require.Equal(t, uint64(0), result)
}

0 comments on commit 74dc563

Please sign in to comment.