MCPcopy Create free account
hub / github.com/bytebase/bytebase / runLimitTest

Function runLimitTest

backend/plugin/db/oracle/query_test.go:252–278  ·  view source on GitHub ↗
(t *testing.T, file string, record bool)

Source from the content-addressed store, hash-verified

250}
251
252func runLimitTest(t *testing.T, file string, record bool) {
253 var testCases []limitTestData
254 filepath := filepath.Join("test-data", file)
255 yamlFile, err := os.Open(filepath)
256 require.NoError(t, err)
257 defer yamlFile.Close()
258
259 byteValue, err := io.ReadAll(yamlFile)
260 require.NoError(t, err)
261 err = yaml.Unmarshal(byteValue, &testCases)
262 require.NoError(t, err)
263
264 for i, tc := range testCases {
265 want := addLimitFor12cAndLater(tc.Stmt, tc.Limit)
266 if record {
267 testCases[i].Want = want
268 } else {
269 require.Equal(t, tc.Want, want, tc.Stmt)
270 }
271 }
272
273 if record {
274 err := yamlFile.Close()
275 require.NoError(t, err)
276 yamltest.Record(t, filepath, testCases)
277 }
278}

Callers 1

Calls 7

RecordFunction · 0.92
addLimitFor12cAndLaterFunction · 0.85
JoinMethod · 0.80
UnmarshalMethod · 0.80
OpenMethod · 0.65
CloseMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected