|
| 1 | +import {ParserJsonTest} from './parser-test.js'; |
| 2 | +import {Configuration} from './node_modules/mathjax-full/js/input/tex/Configuration.js'; |
| 3 | +import {CharacterMap} from './node_modules/mathjax-full/js/input/tex/SymbolMap.js'; |
| 4 | +import ParseMethods from './node_modules/mathjax-full/js/input/tex/ParseMethods.js'; |
| 5 | + |
| 6 | + |
| 7 | +export class ParserMultirelTest extends ParserJsonTest { |
| 8 | + |
| 9 | + constructor(json) { |
| 10 | + // Just some things bogus attributes for testing. |
| 11 | + new CharacterMap('shadow', ParseMethods.mathchar0mo, { |
| 12 | + sim: ['\u223C', {something: 'nothing'}], |
| 13 | + simeq: ['\u2243', {something: 'nothing'}], |
| 14 | + asymp: ['\u224D', {something: 'else'}], |
| 15 | + cong: ['\u224D', {anything: 'nothing'}], |
| 16 | + lesssim: ['\u2272', {lspace: '1pt'}], |
| 17 | + gtrsim: ['\u2278', {rspace: '1pt'}] |
| 18 | + }); |
| 19 | + Configuration.create('multirel-test', {handler: {macro: ['shadow']}, priority: 4}); |
| 20 | + super(json); |
| 21 | + this.packages = ['base', 'ams', 'multirel-test']; |
| 22 | + } |
| 23 | + |
| 24 | +} |
| 25 | + |
| 26 | + |
| 27 | +export class ParserConfigMacrosTest extends ParserJsonTest { |
| 28 | + |
| 29 | + constructor(json) { |
| 30 | + super(json); |
| 31 | + this.packages = ['base', 'configmacros']; |
| 32 | + Object.assign(this.settings, {macros:{}}); |
| 33 | + } |
| 34 | + |
| 35 | + runTest(name, input, expected, {macro, control}) { |
| 36 | + Object.assign(this.settings.macros, macro); |
| 37 | + super.runTest(name, control, expected); |
| 38 | + super.runTest(name, input, expected); |
| 39 | + } |
| 40 | + |
| 41 | +} |
| 42 | + |
0 commit comments