@@ -46,25 +46,28 @@ describe('STEFNOTCH #10', () => {
4646 } ) ;
4747
4848 test ( '4/ \\color{red}3' , ( ) => {
49- expect ( parse ( '\\color{red}3' ) ) . toMatchInlineSnapshot ( `
50- [
51- "Tuple",
52- ["Error", "unexpected-command", ["LatexString", "\\color"]],
53- "r",
54- "ExponentialE",
55- "d",
56- 3
57- ]
58- ` ) ;
49+ expect ( parse ( '\\color{red}3' ) ) . toMatchInlineSnapshot ( `3` ) ;
50+ } ) ;
51+
52+ test ( '4b/ \\color{blue}{x+y}' , ( ) => {
53+ expect ( parse ( '\\color{blue}{x+y}' ) ) . toMatchInlineSnapshot (
54+ `["Add", "x", "y"]`
55+ ) ;
5956 } ) ;
6057
6158 test ( '5/ \\ln(3)' , ( ) => {
6259 expect ( parse ( '\\ln(3)' ) ) . toMatchInlineSnapshot ( `["Ln", 3]` ) ;
6360 } ) ;
6461
65- test ( '6/ f:[a,b]\\to R' , ( ) => {
66- expect ( parse ( 'f:[a,b]\\to R ' ) ) . toMatchInlineSnapshot (
67- `["Sequence", "f", ["Error", ["ErrorCode", "unexpected-token", ":"]]]`
62+ test ( '6/ f:[a,b]\\to\\R' , ( ) => {
63+ expect ( parse ( 'f:[a,b]\\to\\R' ) ) . toMatchInlineSnapshot (
64+ `["Colon", "f", ["To", ["List", "a", "b"], "RealNumbers"]]`
65+ ) ;
66+ } ) ;
67+
68+ test ( '6b/ x:\\R' , ( ) => {
69+ expect ( parse ( 'x:\\R' ) ) . toMatchInlineSnapshot (
70+ `["Colon", "x", "RealNumbers"]`
6871 ) ;
6972 } ) ;
7073
@@ -74,6 +77,10 @@ describe('STEFNOTCH #10', () => {
7477 ) ;
7578 } ) ;
7679
80+ test ( '8a/ \\mleft(x\\mright) parses like \\left(x\\right)' , ( ) => {
81+ expect ( parse ( '\\mleft(x\\mright)' ) ) . toMatchInlineSnapshot ( `x` ) ;
82+ } ) ;
83+
7784 test ( '8/ \\begin{cases} 3 & x < 5 \\\\ 7 & \\text{else} \\end{cases}' , ( ) => {
7885 expect (
7986 parse ( '\\begin{cases} 3 & x < 5 \\\\ 7 & \\text{else} \\end{cases}' )
0 commit comments