괄호 안의 항을 2, 3, 4 항으로 설정하는 기능 추가
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user