move a few things away in to-be-integrated/
[myslice.git] / to-be-integrated / third-party / codemirror-3.15 / mode / stex / test.js
1 (function() {
2   var mode = CodeMirror.getMode({tabSize: 4}, "stex");
3   function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
4
5   MT("word",
6      "foo");
7
8   MT("twoWords",
9      "foo bar");
10
11   MT("beginEndDocument",
12      "[tag \\begin][bracket {][atom document][bracket }]",
13      "[tag \\end][bracket {][atom document][bracket }]");
14
15   MT("beginEndEquation",
16      "[tag \\begin][bracket {][atom equation][bracket }]",
17      "  E=mc^2",
18      "[tag \\end][bracket {][atom equation][bracket }]");
19
20   MT("beginModule",
21      "[tag \\begin][bracket {][atom module][bracket }[[]]]");
22
23   MT("beginModuleId",
24      "[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]");
25
26   MT("importModule",
27      "[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]");
28
29   MT("importModulePath",
30      "[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]");
31
32   MT("psForPDF",
33      "[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]");
34
35   MT("comment",
36      "[comment % foo]");
37
38   MT("tagComment",
39      "[tag \\item][comment % bar]");
40
41   MT("commentTag",
42      " [comment % \\item]");
43
44   MT("commentLineBreak",
45      "[comment %]",
46      "foo");
47
48   MT("tagErrorCurly",
49      "[tag \\begin][error }][bracket {]");
50
51   MT("tagErrorSquare",
52      "[tag \\item][error ]]][bracket {]");
53
54   MT("commentCurly",
55      "[comment % }]");
56
57   MT("tagHash",
58      "the [tag \\#] key");
59
60   MT("tagNumber",
61      "a [tag \\$][atom 5] stetson");
62
63   MT("tagPercent",
64      "[atom 100][tag \\%] beef");
65
66   MT("tagAmpersand",
67      "L [tag \\&] N");
68
69   MT("tagUnderscore",
70      "foo[tag \\_]bar");
71
72   MT("tagBracketOpen",
73      "[tag \\emph][bracket {][tag \\{][bracket }]");
74
75   MT("tagBracketClose",
76      "[tag \\emph][bracket {][tag \\}][bracket }]");
77
78   MT("tagLetterNumber",
79      "section [tag \\S][atom 1]");
80
81   MT("textTagNumber",
82      "para [tag \\P][atom 2]");
83
84   MT("thinspace",
85      "x[tag \\,]y");
86
87   MT("thickspace",
88      "x[tag \\;]y");
89
90   MT("negativeThinspace",
91      "x[tag \\!]y");
92
93   MT("periodNotSentence",
94      "J.\\ L.\\ is");
95
96   MT("periodSentence",
97      "X[tag \\@]. The");
98
99   MT("italicCorrection",
100      "[bracket {][tag \\em] If[tag \\/][bracket }] I");
101
102   MT("tagBracket",
103      "[tag \\newcommand][bracket {][tag \\pop][bracket }]");
104
105   MT("inlineMathTagFollowedByNumber",
106      "[keyword $][tag \\pi][number 2][keyword $]");
107
108   MT("inlineMath",
109      "[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text");
110
111   MT("displayMath",
112      "More [keyword $$]\t[variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text");
113
114   MT("mathWithComment",
115      "[keyword $][variable-2 x] [comment % $]",
116      "[variable-2 y][keyword $] other text");
117
118   MT("lineBreakArgument",
119     "[tag \\\\][bracket [[][atom 1cm][bracket ]]]");
120 })();