// String returns a string that contains generated testify.Suite
String returns a string that contains generated testify.Suite
// String returns a string that contains generated testify . Suite
func (s *Suite) String() string {
	tmpl, err := template.New("test").Parse(
		suiteTemplate,
	)
	if err != nil {
		panic(err.Error())
	}
	cleanup := s.Cleanup.String()
	if len(cleanup) > 0 {
		cleanup = fmt.Sprintf(`	s.T().Cleanup(func() {
		%v
	})`, cleanup)
	}
	var result = new(strings.Builder)
	_ = tmpl.Execute(result, struct {
		Dir                string
		Name               string
		Cleanup            string
		Run                string
		Fields             string
		Imports            string
		Setup              string
		TestIncludedSuites string
	}{
		Dir:                s.Dir,
		Name:               s.Name(),
		Cleanup:            cleanup,
		Run:                s.Run.String(),
		Imports:            s.Deps.String(),
		Fields:             s.Deps.FieldsString(),
		Setup:              s.DepsToSetup.SetupString(),
		TestIncludedSuites: s.generateChildrenTesting(),
	})
	if len(s.Tests) == 0 {
		s.Tests = append(s.Tests, new(Test))
	}
	for _, test := range s.Tests {
		_, _ = result.WriteString(test.String())
	}
	return spaceRegex.ReplaceAllString(strings.TrimSpace(result.String()), "\n")
}
func ( s * Suite ) String ( ) string { tmpl , err := template . New ( " " ) . Parse ( suiteTemplate , ) if err != nil { panic ( err . Error ( ) ) } cleanup := s . Cleanup . String ( ) if len ( cleanup ) > 0 { cleanup = fmt . Sprintf ( `	s.T().Cleanup(func() {
		%v
	})` , cleanup ) } var result = new ( strings . Builder ) _ = tmpl . Execute ( result , struct { Dir string Name string Cleanup string Run string Fields string Imports string Setup string TestIncludedSuites string } { Dir : s . Dir , Name : s . Name ( ) , Cleanup : cleanup , Run : s . Run . String ( ) , Imports : s . Deps . String ( ) , Fields : s . Deps . FieldsString ( ) , Setup : s . DepsToSetup . SetupString ( ) , TestIncludedSuites : s . generateChildrenTesting ( ) , } ) if len ( s . Tests ) == 0 { s . Tests = append ( s . Tests , new ( Test ) ) } for _ , test := range s . Tests { _ , _ = result . WriteString ( test . String ( ) ) } return spaceRegex . ReplaceAllString ( strings . TrimSpace ( result . String ( ) ) , " \n " ) }
String returns a string that contains generated testify.Suite
String returns a string that contains generated testify . Suite