Skip to content

Commit

Permalink
Merge pull request #42 from mathjax/exhaustive-tests
Browse files Browse the repository at this point in the history
Exhaustive tests
  • Loading branch information
zorkow authored Oct 28, 2020
2 parents 3b07ddc + ad0ae93 commit ebbf80b
Show file tree
Hide file tree
Showing 44 changed files with 87,400 additions and 32 deletions.
3 changes: 2 additions & 1 deletion samples/tex-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import {chooseAdaptor} from '../mathjax3/js/adaptors/chooseAdaptor.js';
import {STATE} from '../mathjax3/js/core/MathItem.js';
import {AllPackages} from '../mathjax3/js/input/tex/AllPackages.js';
import {CHTML} from '../mathjax3/js/output/chtml.js';
import '../mathjax3/js/input/tex/physics/PhysicsConfiguration.js';

RegisterHTMLHandler(chooseAdaptor());

let html = mathjax.document('<html></html>', {
InputJax: new TeX({packages: AllPackages}),
InputJax: new TeX({packages: ['base', 'physics']}),
OutputJax: new CHTML()
});

Expand Down
242 changes: 242 additions & 0 deletions tests/json/tex_packages/action/action-macros.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
{
"name": "action action-macros table test",
"factory": "parserTest",
"packages": [
"base",
"action"
],
"tests": {
"toggle": {
"input": "\\toggle{A}{B}\\endtoggle",
"expected": {
"kind": "math",
"texClass": 0,
"attributes": {
"display": "block"
},
"inherited": {
"displaystyle": true,
"scriptlevel": 0
},
"properties": {},
"childNodes": [
{
"kind": "mrow",
"texClass": 0,
"attributes": {},
"inherited": {
"displaystyle": true,
"scriptlevel": 0
},
"properties": {},
"childNodes": [
{
"kind": "maction",
"texClass": 0,
"attributes": {},
"inherited": {
"displaystyle": true,
"scriptlevel": 0
},
"properties": {},
"childNodes": [
{
"kind": "mi",
"texClass": 0,
"attributes": {},
"inherited": {
"displaystyle": true,
"scriptlevel": 0,
"mathvariant": "italic"
},
"properties": {},
"childNodes": [
{
"kind": "text",
"text": "A"
}
]
},
{
"kind": "mi",
"texClass": 0,
"attributes": {},
"inherited": {
"displaystyle": true,
"scriptlevel": 0,
"mathvariant": "italic"
},
"properties": {},
"childNodes": [
{
"kind": "text",
"text": "B"
}
]
}
]
}
],
"isInferred": true
}
]
}
},
"mathtip": {
"input": "\\mathtip{A}{B}",
"expected": {
"kind": "math",
"texClass": 0,
"attributes": {
"display": "block"
},
"inherited": {
"displaystyle": true,
"scriptlevel": 0
},
"properties": {},
"childNodes": [
{
"kind": "mrow",
"texClass": 0,
"attributes": {},
"inherited": {
"displaystyle": true,
"scriptlevel": 0
},
"properties": {},
"childNodes": [
{
"kind": "maction",
"texClass": 0,
"attributes": {
"actiontype": "tooltip"
},
"inherited": {
"displaystyle": true,
"scriptlevel": 0
},
"properties": {},
"childNodes": [
{
"kind": "mi",
"texClass": 0,
"attributes": {},
"inherited": {
"displaystyle": true,
"scriptlevel": 0,
"mathvariant": "italic"
},
"properties": {},
"childNodes": [
{
"kind": "text",
"text": "A"
}
]
},
{
"kind": "mi",
"texClass": 0,
"attributes": {},
"inherited": {
"displaystyle": true,
"scriptlevel": 0,
"mathvariant": "italic"
},
"properties": {},
"childNodes": [
{
"kind": "text",
"text": "B"
}
]
}
]
}
],
"isInferred": true
}
]
}
},
"texttip": {
"input": "\\texttip{A}{B}",
"expected": {
"kind": "math",
"texClass": 0,
"attributes": {
"display": "block"
},
"inherited": {
"displaystyle": true,
"scriptlevel": 0
},
"properties": {},
"childNodes": [
{
"kind": "mrow",
"texClass": 0,
"attributes": {},
"inherited": {
"displaystyle": true,
"scriptlevel": 0
},
"properties": {},
"childNodes": [
{
"kind": "maction",
"texClass": 0,
"attributes": {
"actiontype": "tooltip"
},
"inherited": {
"displaystyle": true,
"scriptlevel": 0
},
"properties": {},
"childNodes": [
{
"kind": "mi",
"texClass": 0,
"attributes": {},
"inherited": {
"displaystyle": true,
"scriptlevel": 0,
"mathvariant": "italic"
},
"properties": {},
"childNodes": [
{
"kind": "text",
"text": "A"
}
]
},
{
"kind": "mtext",
"texClass": 0,
"attributes": {},
"inherited": {
"displaystyle": true,
"scriptlevel": 0
},
"properties": {},
"childNodes": [
{
"kind": "text",
"text": "B"
}
],
"isSpacelike": true
}
]
}
],
"isInferred": true
}
]
}
}
}
}
Loading

0 comments on commit ebbf80b

Please sign in to comment.