mirror of
https://github.com/stretchr/testify.git
synced 2025-07-13 15:48:34 +00:00
Change to guard clause
This commit is contained in:
parent
a41f2db807
commit
f43aa3c488
@ -181,7 +181,9 @@ func Run(t *testing.T, suite TestingSuite) {
|
|||||||
func runTests(t testing.TB, tests []testing.InternalTest) {
|
func runTests(t testing.TB, tests []testing.InternalTest) {
|
||||||
if len(tests) == 0 {
|
if len(tests) == 0 {
|
||||||
t.Log("warning: no tests to run")
|
t.Log("warning: no tests to run")
|
||||||
} else {
|
return
|
||||||
|
}
|
||||||
|
|
||||||
r, ok := t.(runner)
|
r, ok := t.(runner)
|
||||||
if !ok { // backwards compatibility with Go 1.6 and below
|
if !ok { // backwards compatibility with Go 1.6 and below
|
||||||
if !testing.RunTests(allTestsFilter, tests) {
|
if !testing.RunTests(allTestsFilter, tests) {
|
||||||
@ -193,7 +195,6 @@ func runTests(t testing.TB, tests []testing.InternalTest) {
|
|||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
r.Run(test.Name, test.F)
|
r.Run(test.Name, test.F)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filtering method according to set regular expression
|
// Filtering method according to set regular expression
|
||||||
|
Loading…
x
Reference in New Issue
Block a user