MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / check

Function check

test/compute-engine/power-combination.test.ts:4–21  ·  view source on GitHub ↗
(
  latex: string,
  expected: Expression,
  options?: { simplify?: boolean; assume?: string[] }
)

Source from the content-addressed store, hash-verified

2import type { MathJsonExpression as Expression } from '../../src/math-json/types';
3
4function check(
5 latex: string,
6 expected: Expression,
7 options?: { simplify?: boolean; assume?: string[] }
8): void {
9 const ce = engine;
10 ce.pushScope();
11 try {
12 if (options?.assume) {
13 for (const a of options.assume) ce.assume(ce.parse(a));
14 }
15 const expr = ce.parse(latex);
16 const result = options?.simplify ? expr.simplify() : expr;
17 expect(result.json).toEqual(expected);
18 } finally {
19 ce.popScope();
20 }
21}
22
23describe('Power Combination (#176)', () => {
24 test('numeric base with symbolic exponent', () => {

Callers 1

Calls 5

pushScopeMethod · 0.65
assumeMethod · 0.65
parseMethod · 0.65
simplifyMethod · 0.65
popScopeMethod · 0.65

Tested by

no test coverage detected