add regression test for sequence error recovery

This commit is contained in:
Horizontal42 2026-07-29 14:14:49 +03:00
parent ca6fa6d381
commit 1a12d75ec6

View file

@ -215,6 +215,12 @@ describe("numeral systems", () => {
}); });
describe("variables and document context", () => { describe("variables and document context", () => {
it("sequence error recovery", () => {
eng.addFunction({ id: "throw_err", phrases: "throw_err" }, () => {
throw new Error("test error");
});
expect(calc("throw_err(1) 2 hours")).toBe("2 h");
});
it("assignment and reuse", () => { it("assignment and reuse", () => {
expect(calcDoc("x = 5\nx * 2")).toEqual(["5", "10"]); expect(calcDoc("x = 5\nx * 2")).toEqual(["5", "10"]);
}); });