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

Function check

test/compute-engine/latex-syntax/sequences.test.ts:4–25  ·  view source on GitHub ↗
(arg: string | Expression)

Source from the content-addressed store, hash-verified

2import { engine, exprToString } from '../../utils';
3
4function check(arg: string | Expression): string {
5 const boxed =
6 typeof arg === 'string'
7 ? engine.parse(arg, { form: 'raw' })
8 : engine.expr(arg, { form: 'raw' });
9 const canonical = boxed.canonical;
10 // const evaluated = canonical.evaluate();
11
12 const boxStr = exprToString(boxed);
13 const canonicalStr = exprToString(canonical);
14
15 let result =
16 boxStr === canonicalStr
17 ? boxStr
18 : `box = ${boxStr}
19canonical = ${canonicalStr}`;
20
21 result += `\nbox-latex = ${boxed.latex}\nlatex = ${canonical.latex}`;
22
23 return result;
24 // evaluated = ${printExpression(evaluated.json)}`;
25}
26
27describe('SEQUENCES SERIALIZING', () => {
28 // A `Sequence` of numbers must NOT serialize with a bare space between the

Callers 1

sequences.test.tsFile · 0.70

Calls 3

exprToStringFunction · 0.90
parseMethod · 0.65
exprMethod · 0.65

Tested by

no test coverage detected