()
| 18 | ) |
| 19 | |
| 20 | func searchForSuperSQL() ([]string, error) { |
| 21 | var queries []string |
| 22 | pattern := fmt.Sprintf(`.*ztests\%c.*\.yaml$`, filepath.Separator) |
| 23 | re := regexp.MustCompile(pattern) |
| 24 | err := filepath.Walk("..", func(path string, info os.FileInfo, err error) error { |
| 25 | if !info.IsDir() && strings.HasSuffix(path, ".yaml") && re.MatchString(path) { |
| 26 | ztests, err := ztest.FromYAMLFile(path) |
| 27 | if err != nil { |
| 28 | return fmt.Errorf("%s: %w", path, err) |
| 29 | } |
| 30 | for _, z := range ztests { |
| 31 | if s := z.SPQ; s != "" { |
| 32 | queries = append(queries, s) |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | return err |
| 37 | }) |
| 38 | return queries, err |
| 39 | } |
| 40 | |
| 41 | func parseOp(z string) ([]byte, error) { |
| 42 | ast, err := parser.ParseText(z) |
no test coverage detected