Hello guys,
We've found one funny thing about suite.Run. It allows running inner suites (that look awesome to me :) ). But this working some strange if passed testify.m parameter.
For example:
package mypkg_test
import "github.com/stretchr/testify/suite"
type suite1 struct{
suite.Suite
}
func (s *suite1) Test1() {
println("test1")
}
type suite2 struct{
suite.Suite
}
func (s *suite2) Test2() {
suite.Run(s.T(), new(suite1))
}
func TestSuite2(t *testing.T) {
suite.Run(t, new(suite2))
}
So if I just run TestSuite2 then it works fine (suite2 runs all tests from suite1).
But if I run TestSuite2 with paramter -testify.m="Test2" then suite1 will be ignored.
Please share your thoughts about:
- Is sub suites legal?
- Should the matching filter ignore sub suites?