(re string)
| 13 | ) |
| 14 | |
| 15 | func generateRegexpChecker(re string) func([]byte) error { |
| 16 | return func(val []byte) error { |
| 17 | matched, err := regexp.MatchString(re, string(val)) |
| 18 | if err != nil { |
| 19 | return errors.New("Error while trying to match the input message with the expected pattern: " + err.Error()) |
| 20 | } |
| 21 | if !matched { |
| 22 | return fmt.Errorf("No match between input value \"%s\" and expected pattern \"%s\"", val, re) |
| 23 | } |
| 24 | return nil |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | type testReporterMock struct { |
| 29 | errors []string |
no test coverage detected