@@ -45,10 +45,13 @@ const expression: Expression = ['Add', 2, ['Multiply', 3, 'x']];
4545const symbol :Expression = 'x' ;
4646const dict :Expression = [
4747'Dictionary' ,
48- [ 'Tuple' , 'x' , 1 ] ,
49- [ 'Tuple' , 'y' , 2 ] ,
50- [ 'Tuple' , 'z' , 3 ] ,
48+ [ 'Tuple' , { str : 'x' } , 1 ] ,
49+ [ 'Tuple' , { str : 'y' } , 2 ] ,
50+ [ 'Tuple' , { str : 'z' } , 3 ] ,
5151] ;
52+
53+ const dictShorthand :Expression = { dict :{ x :1 , y :2 , z :3 } } ;
54+
5255const tuple :Expression = [ 'Tuple' , 7 , 10 , 13 ] ;
5356
5457describe ( 'COUNT' , ( ) => {
@@ -94,8 +97,10 @@ describe('COUNT', () => {
9497 ]
9598 ` ) ) ;
9699
97- test ( 'Count dict' , ( ) =>
98- expect ( evaluate ( [ 'Count' , dict ] ) ) . toMatchInlineSnapshot ( `3` ) ) ;
100+ test ( 'Count dict' , ( ) => {
101+ expect ( evaluate ( [ 'Count' , dict ] ) ) . toMatchInlineSnapshot ( `3` ) ;
102+ expect ( evaluate ( [ 'Count' , dictShorthand ] ) ) . toMatchInlineSnapshot ( `3` ) ;
103+ } ) ;
99104
100105test ( 'Count tuple' , ( ) =>
101106expect ( evaluate ( [ 'Count' , tuple ] ) ) . toMatchInlineSnapshot ( `3` ) ) ;
@@ -178,6 +183,22 @@ describe('TAKE', () => {
178183 1
179184 ]
180185 ` ) ;
186+
187+ expect ( evaluate ( [ 'Take' , dictShorthand , 1 ] ) ) . toMatchInlineSnapshot ( `
188+ [
189+ "Take",
190+ [
191+ "Error",
192+ [
193+ "ErrorCode",
194+ "incompatible-type",
195+ "'indexed_collection'",
196+ "dictionary<finite_integer>"
197+ ]
198+ ],
199+ 1
200+ ]
201+ ` ) ;
181202} ) ;
182203} ) ;
183204