Unit test with Table-driven style
Open
good first issue
help wanted
type/enhancement
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 783
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 36
Description
## Feature Request
In current unit test coverage situation, I found that, in most cases, the error handling hasn't been covered due to we only prepared the success cases in current unit test.
Here is one example:

To cover the error handling in the function, I'd like to introduce the [`Table-driven`](https://github.com/golang/go/wiki/TableDrivenTests#parallel-testing) ut style.
Here is one example to show how we use table-driver style to cover the error handling cases.
https://github.com/pingcap/pd/pull/2589
Contributor guide
Assessment
This issue has not been assessed yet.