-
Notifications
You must be signed in to change notification settings - Fork 403
Open
Description
Hey, after add the support for testify with delve, What do you think about implement support for subtests using testify/suite library with delve.
Give an example:
type ExampleSuite struct {
suite.Suite
value int
}
func (s *ExampleSuite) SetupTest() {
s.value = 10
}
func (s *ExampleSuite) TestSubtraction() {
s.Run("test with negative numbers", func() {
result := s.value - 3
s.Equal(7, result)
})
s.Run("test with positive numbers", func() {
result := s.value - 3
s.Equal(7, result)
})
}
func TestExampleSuite(t *testing.T) {
suite.Run(t, new(ExampleSuite))
}If i try to run TestNearest inside the subtest test with negative numbers will execute all subtests inside the Method TestSubtraction. So i try to understand this piece of code for create a new pattern:
let test#go#patterns = {
\ 'test': [
\ '\v^\s*func ((Test|Example).*)\(',
\ '\v^\s*func \(.*\) ((Test).*)\(',
\ '\v^\s*t\.Run\("(.*)"',
\],
\ 'namespace': [
\ '\v^\s*func ((Test).*)\(',
\ '\v^\s*t\.Run\("(.*)"',
\],
\}But it is seems a litte hard, do you have any idea how i could implement this pattern ?
Metadata
Metadata
Assignees
Labels
No labels