(tb testing.TB, filename string)
| 154 | } |
| 155 | |
| 156 | func LoadQueriesFromFile(tb testing.TB, filename string) { |
| 157 | conn := GetMySQLConnection(tb) |
| 158 | file := filepath.Join("testdata", filename) |
| 159 | data, err := ioutil.ReadFile(file) |
| 160 | if err != nil { |
| 161 | fmt.Printf("%s cannot load json file %q: %s\n\n", caller(), file, err) |
| 162 | tb.FailNow() |
| 163 | } |
| 164 | _, err = conn.Exec(string(data)) |
| 165 | if err != nil { |
| 166 | fmt.Printf("%s cannot load queries from %q: %s\n\n", caller(), file, err) |
| 167 | tb.FailNow() |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func LoadJson(tb testing.TB, filename string, dest interface{}) { |
| 172 | file := filepath.Join("testdata", filename) |
nothing calls this directly
no test coverage detected