// AddExpectations adds expected / not expected sets of lines of code to the current run
AddExpectations adds expected / not expected sets of lines of code to the current run
// AddExpectations adds expected / not expected sets of lines of code to the current run
func (r *modelTestRun) AddExpectations(file string, expectedCode, notExpectedCode, expectedLogs, notExpectedLogs []string) {
	k := strings.ToLower(swag.ToJSONName(strings.TrimSuffix(file, ".go")))
	if def, ok := r.Definitions[k]; ok {
		def.ExpectedLines = append(def.ExpectedLines, expectedCode...)
		def.NotExpectedLines = append(def.NotExpectedLines, notExpectedCode...)
		def.ExpectedLogs = append(def.ExpectedLogs, expectedLogs...)
		def.NotExpectedLogs = append(def.NotExpectedLogs, notExpectedLogs...)
		return
	}
	r.Definitions[k] = &modelExpectations{
		GeneratedFile:    file,
		ExpectedLines:    expectedCode,
		NotExpectedLines: notExpectedCode,
		ExpectedLogs:     expectedLogs,
		NotExpectedLogs:  notExpectedLogs,
	}
}
func ( r * modelTestRun ) AddExpectations ( file string , expectedCode , notExpectedCode , expectedLogs , notExpectedLogs [ ] string ) { k := strings . ToLower ( swag . ToJSONName ( strings . TrimSuffix ( file , " " ) ) ) if def , ok := r . Definitions [ k ] ; ok { def . ExpectedLines = append ( def . ExpectedLines , expectedCode ... ) def . NotExpectedLines = append ( def . NotExpectedLines , notExpectedCode ... ) def . ExpectedLogs = append ( def . ExpectedLogs , expectedLogs ... ) def . NotExpectedLogs = append ( def . NotExpectedLogs , notExpectedLogs ... ) return } r . Definitions [ k ] = & modelExpectations { GeneratedFile : file , ExpectedLines : expectedCode , NotExpectedLines : notExpectedCode , ExpectedLogs : expectedLogs , NotExpectedLogs : notExpectedLogs , } }
AddExpectations adds expected / not expected sets of lines of code to the current run
AddExpectations adds expected / not expected sets of lines of code to the current run