Skip to content

Commit ebbf80b

Browse files
authored
Merge pull request #42 from mathjax/exhaustive-tests
Exhaustive tests
2 parents 3b07ddc + ad0ae93 commit ebbf80b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+87400
-32
lines changed

samples/tex-json.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ import {chooseAdaptor} from '../mathjax3/js/adaptors/chooseAdaptor.js';
66
import {STATE} from '../mathjax3/js/core/MathItem.js';
77
import {AllPackages} from '../mathjax3/js/input/tex/AllPackages.js';
88
import {CHTML} from '../mathjax3/js/output/chtml.js';
9+
import '../mathjax3/js/input/tex/physics/PhysicsConfiguration.js';
910

1011
RegisterHTMLHandler(chooseAdaptor());
1112

1213
let html = mathjax.document('<html></html>', {
13-
InputJax: new TeX({packages: AllPackages}),
14+
InputJax: new TeX({packages: ['base', 'physics']}),
1415
OutputJax: new CHTML()
1516
});
1617

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
{
2+
"name": "action action-macros table test",
3+
"factory": "parserTest",
4+
"packages": [
5+
"base",
6+
"action"
7+
],
8+
"tests": {
9+
"toggle": {
10+
"input": "\\toggle{A}{B}\\endtoggle",
11+
"expected": {
12+
"kind": "math",
13+
"texClass": 0,
14+
"attributes": {
15+
"display": "block"
16+
},
17+
"inherited": {
18+
"displaystyle": true,
19+
"scriptlevel": 0
20+
},
21+
"properties": {},
22+
"childNodes": [
23+
{
24+
"kind": "mrow",
25+
"texClass": 0,
26+
"attributes": {},
27+
"inherited": {
28+
"displaystyle": true,
29+
"scriptlevel": 0
30+
},
31+
"properties": {},
32+
"childNodes": [
33+
{
34+
"kind": "maction",
35+
"texClass": 0,
36+
"attributes": {},
37+
"inherited": {
38+
"displaystyle": true,
39+
"scriptlevel": 0
40+
},
41+
"properties": {},
42+
"childNodes": [
43+
{
44+
"kind": "mi",
45+
"texClass": 0,
46+
"attributes": {},
47+
"inherited": {
48+
"displaystyle": true,
49+
"scriptlevel": 0,
50+
"mathvariant": "italic"
51+
},
52+
"properties": {},
53+
"childNodes": [
54+
{
55+
"kind": "text",
56+
"text": "A"
57+
}
58+
]
59+
},
60+
{
61+
"kind": "mi",
62+
"texClass": 0,
63+
"attributes": {},
64+
"inherited": {
65+
"displaystyle": true,
66+
"scriptlevel": 0,
67+
"mathvariant": "italic"
68+
},
69+
"properties": {},
70+
"childNodes": [
71+
{
72+
"kind": "text",
73+
"text": "B"
74+
}
75+
]
76+
}
77+
]
78+
}
79+
],
80+
"isInferred": true
81+
}
82+
]
83+
}
84+
},
85+
"mathtip": {
86+
"input": "\\mathtip{A}{B}",
87+
"expected": {
88+
"kind": "math",
89+
"texClass": 0,
90+
"attributes": {
91+
"display": "block"
92+
},
93+
"inherited": {
94+
"displaystyle": true,
95+
"scriptlevel": 0
96+
},
97+
"properties": {},
98+
"childNodes": [
99+
{
100+
"kind": "mrow",
101+
"texClass": 0,
102+
"attributes": {},
103+
"inherited": {
104+
"displaystyle": true,
105+
"scriptlevel": 0
106+
},
107+
"properties": {},
108+
"childNodes": [
109+
{
110+
"kind": "maction",
111+
"texClass": 0,
112+
"attributes": {
113+
"actiontype": "tooltip"
114+
},
115+
"inherited": {
116+
"displaystyle": true,
117+
"scriptlevel": 0
118+
},
119+
"properties": {},
120+
"childNodes": [
121+
{
122+
"kind": "mi",
123+
"texClass": 0,
124+
"attributes": {},
125+
"inherited": {
126+
"displaystyle": true,
127+
"scriptlevel": 0,
128+
"mathvariant": "italic"
129+
},
130+
"properties": {},
131+
"childNodes": [
132+
{
133+
"kind": "text",
134+
"text": "A"
135+
}
136+
]
137+
},
138+
{
139+
"kind": "mi",
140+
"texClass": 0,
141+
"attributes": {},
142+
"inherited": {
143+
"displaystyle": true,
144+
"scriptlevel": 0,
145+
"mathvariant": "italic"
146+
},
147+
"properties": {},
148+
"childNodes": [
149+
{
150+
"kind": "text",
151+
"text": "B"
152+
}
153+
]
154+
}
155+
]
156+
}
157+
],
158+
"isInferred": true
159+
}
160+
]
161+
}
162+
},
163+
"texttip": {
164+
"input": "\\texttip{A}{B}",
165+
"expected": {
166+
"kind": "math",
167+
"texClass": 0,
168+
"attributes": {
169+
"display": "block"
170+
},
171+
"inherited": {
172+
"displaystyle": true,
173+
"scriptlevel": 0
174+
},
175+
"properties": {},
176+
"childNodes": [
177+
{
178+
"kind": "mrow",
179+
"texClass": 0,
180+
"attributes": {},
181+
"inherited": {
182+
"displaystyle": true,
183+
"scriptlevel": 0
184+
},
185+
"properties": {},
186+
"childNodes": [
187+
{
188+
"kind": "maction",
189+
"texClass": 0,
190+
"attributes": {
191+
"actiontype": "tooltip"
192+
},
193+
"inherited": {
194+
"displaystyle": true,
195+
"scriptlevel": 0
196+
},
197+
"properties": {},
198+
"childNodes": [
199+
{
200+
"kind": "mi",
201+
"texClass": 0,
202+
"attributes": {},
203+
"inherited": {
204+
"displaystyle": true,
205+
"scriptlevel": 0,
206+
"mathvariant": "italic"
207+
},
208+
"properties": {},
209+
"childNodes": [
210+
{
211+
"kind": "text",
212+
"text": "A"
213+
}
214+
]
215+
},
216+
{
217+
"kind": "mtext",
218+
"texClass": 0,
219+
"attributes": {},
220+
"inherited": {
221+
"displaystyle": true,
222+
"scriptlevel": 0
223+
},
224+
"properties": {},
225+
"childNodes": [
226+
{
227+
"kind": "text",
228+
"text": "B"
229+
}
230+
],
231+
"isSpacelike": true
232+
}
233+
]
234+
}
235+
],
236+
"isInferred": true
237+
}
238+
]
239+
}
240+
}
241+
}
242+
}

0 commit comments

Comments
 (0)