@@ -1112,6 +1112,34 @@ func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...inter
11121112 t .FailNow ()
11131113}
11141114
1115+ // Negative asserts that the specified element is negative
1116+ //
1117+ // assert.Negative(t, -1)
1118+ // assert.Negative(t, -1.23)
1119+ func Negative (t TestingT , e interface {}, msgAndArgs ... interface {}) {
1120+ if h , ok := t .(tHelper ); ok {
1121+ h .Helper ()
1122+ }
1123+ if assert .Negative (t , e , msgAndArgs ... ) {
1124+ return
1125+ }
1126+ t .FailNow ()
1127+ }
1128+
1129+ // Negativef asserts that the specified element is negative
1130+ //
1131+ // assert.Negativef(t, -1, "error message %s", "formatted")
1132+ // assert.Negativef(t, -1.23, "error message %s", "formatted")
1133+ func Negativef (t TestingT , e interface {}, msg string , args ... interface {}) {
1134+ if h , ok := t .(tHelper ); ok {
1135+ h .Helper ()
1136+ }
1137+ if assert .Negativef (t , e , msg , args ... ) {
1138+ return
1139+ }
1140+ t .FailNow ()
1141+ }
1142+
11151143// Never asserts that the given condition doesn't satisfy in waitFor time,
11161144// periodically checking the target function each tick.
11171145//
@@ -1638,6 +1666,34 @@ func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}
16381666 t .FailNow ()
16391667}
16401668
1669+ // Positive asserts that the specified element is positive
1670+ //
1671+ // assert.Positive(t, 1)
1672+ // assert.Positive(t, 1.23)
1673+ func Positive (t TestingT , e interface {}, msgAndArgs ... interface {}) {
1674+ if h , ok := t .(tHelper ); ok {
1675+ h .Helper ()
1676+ }
1677+ if assert .Positive (t , e , msgAndArgs ... ) {
1678+ return
1679+ }
1680+ t .FailNow ()
1681+ }
1682+
1683+ // Positivef asserts that the specified element is positive
1684+ //
1685+ // assert.Positivef(t, 1, "error message %s", "formatted")
1686+ // assert.Positivef(t, 1.23, "error message %s", "formatted")
1687+ func Positivef (t TestingT , e interface {}, msg string , args ... interface {}) {
1688+ if h , ok := t .(tHelper ); ok {
1689+ h .Helper ()
1690+ }
1691+ if assert .Positivef (t , e , msg , args ... ) {
1692+ return
1693+ }
1694+ t .FailNow ()
1695+ }
1696+
16411697// Regexp asserts that a specified regexp matches a string.
16421698//
16431699// assert.Regexp(t, regexp.MustCompile("start"), "it's starting")
0 commit comments