(arg: string | Expression)
| 2 | import { engine, exprToString } from '../../utils'; |
| 3 | |
| 4 | function 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} |
| 19 | canonical = ${canonicalStr}`; |
| 20 | |
| 21 | result += `\nbox-latex = ${boxed.latex}\nlatex = ${canonical.latex}`; |
| 22 | |
| 23 | return result; |
| 24 | // evaluated = ${printExpression(evaluated.json)}`; |
| 25 | } |
| 26 | |
| 27 | describe('SEQUENCES SERIALIZING', () => { |
| 28 | // A `Sequence` of numbers must NOT serialize with a bare space between the |
no test coverage detected