Skip to content

Commit 3eeda24

Browse files
committed
Adds tests for factory.
1 parent ca15da6 commit 3eeda24

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

tests/other-test.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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

Comments
 (0)