MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / auto

Function auto

packages/ui-default/components/problemconfig/tree/AddTestcase.tsx:64–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62 }
63
64 function auto() {
65 const state = store.getState();
66 const subtasks = readSubtasksFromFiles(state.testdata.map((i) => i.name), {});
67 const current = state.config.subtasks.flatMap((i) => i.cases).concat(state.config.__cases);
68 const pending = [];
69 for (const c of subtasks.flatMap((s) => s.cases)) {
70 if (!current.find((i) => i.input === c.input && i.output === c.output)) {
71 pending.push({
72 input: c.input,
73 output: c.output,
74 });
75 }
76 }
77 store.dispatch({
78 type: 'problemconfig/addTestcases',
79 cases: pending,
80 });
81 }
82
83 return (<>
84 <div

Callers

nothing calls this directly

Calls 3

readSubtasksFromFilesFunction · 0.90
findMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected