괄호 안의 항을 2, 3, 4 항으로 설정하는 기능 추가

This commit is contained in:
2026-05-31 13:40:45 +09:00
parent e148a957ea
commit ac3c939051
21 changed files with 708 additions and 344 deletions
+12 -1
View File
@@ -63,8 +63,19 @@ describe("parenthesis sign problem engine", () => {
expect(keys.size).toBe(10);
});
it("generates the selected number of terms inside parentheses", () => {
const problem = generateProblem(4);
expect(problem.terms).toHaveLength(4);
expect(problem.operators).toHaveLength(3);
expect(problem.distributedTerms).toHaveLength(4);
expect(
gradeAnswer(problem, { terms: problem.distributedTerms }).correct,
).toBe(true);
});
it("rejects impossible session sizes", () => {
expect(() => generateSession(0)).toThrow();
expect(() => generateSession(145)).toThrow();
expect(() => generateSession(1297)).toThrow();
});
});