add interface request verification method.

This commit is contained in:
徐聪
2021-12-29 15:23:36 +08:00
parent 1bcd5acfab
commit 86b50e6d0d
5 changed files with 164 additions and 42 deletions
+4 -4
View File
@@ -71,7 +71,7 @@ func GreaterThanLength(t assert.TestingT, expected, actual interface{}, msgAndAr
if !ok {
return assert.Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", actual), msgAndArgs...)
}
if l > length {
if l <= length {
return assert.Fail(t, fmt.Sprintf("\"%s\" should be more than %d item(s), but has %d", actual, length, l), msgAndArgs...)
}
return true
@@ -86,7 +86,7 @@ func GreaterOrEqualsLength(t assert.TestingT, expected, actual interface{}, msgA
if !ok {
return assert.Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", actual), msgAndArgs...)
}
if l >= length {
if l < length {
return assert.Fail(t, fmt.Sprintf("\"%s\" should be no less than %d item(s), but has %d", actual, length, l), msgAndArgs...)
}
return true
@@ -101,7 +101,7 @@ func LessThanLength(t assert.TestingT, expected, actual interface{}, msgAndArgs
if !ok {
return assert.Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", actual), msgAndArgs...)
}
if l < length {
if l >= length {
return assert.Fail(t, fmt.Sprintf("\"%s\" should be less than %d item(s), but has %d", actual, length, l), msgAndArgs...)
}
return true
@@ -116,7 +116,7 @@ func LessOrEqualsLength(t assert.TestingT, expected, actual interface{}, msgAndA
if !ok {
return assert.Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", actual), msgAndArgs...)
}
if l <= length {
if l > length {
return assert.Fail(t, fmt.Sprintf("\"%s\" should be no more than %d item(s), but has %d", actual, length, l), msgAndArgs...)
}
return true