change: add unittest for EqualLength

This commit is contained in:
debugtalk
2021-10-04 18:35:25 +08:00
parent 098c5b9c94
commit 4c8bb400a1
2 changed files with 23 additions and 0 deletions

View File

@@ -49,5 +49,8 @@ func EndsWith(t assert.TestingT, expected, actual interface{}, msgAndArgs ...int
}
func EqualLength(t assert.TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
if !assert.IsType(t, 129, expected, fmt.Sprintf("expected type is not int, got %#v", expected)) {
return false
}
return assert.Len(t, actual, expected.(int), msgAndArgs...)
}