(t *testing.T, table []testCase, enableWindowFunc bool)
| 251 | } |
| 252 | |
| 253 | func RunTest(t *testing.T, table []testCase, enableWindowFunc bool) { |
| 254 | parser := parser.New() |
| 255 | parser.EnableWindowFunc(enableWindowFunc) |
| 256 | for _, tbl := range table { |
| 257 | _, _, err := parser.Parse(tbl.src, "", "") |
| 258 | if !tbl.ok { |
| 259 | require.Errorf(t, err, "source %v", tbl.src, errors.Trace(err)) |
| 260 | continue |
| 261 | } |
| 262 | require.NoErrorf(t, err, "source %v", tbl.src, errors.Trace(err)) |
| 263 | // restore correctness test |
| 264 | if tbl.ok { |
| 265 | RunRestoreTest(t, tbl.src, tbl.restore, enableWindowFunc) |
| 266 | } |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | func RunRestoreTest(t *testing.T, sourceSQLs, expectSQLs string, enableWindowFunc bool) { |
| 271 | var sb strings.Builder |
no test coverage detected