@@ -25,7 +25,7 @@ function assertValueType(
2525 context : AnnotationContext ,
2626 followSpecificPath ?: string [ ] ,
2727) {
28- const ast = parseExpression ( expression , { } ) ;
28+ const ast = parseExpression ( expression , { version : 3.1 } ) ;
2929 if ( context ) annotateAst ( ast , context ) ;
3030 else annotateAst ( ast , new AnnotationContext ( undefined ) ) ;
3131
@@ -371,20 +371,20 @@ describe('Annotation counting', () => {
371371 [ 'b' , { type : ValueType . XSINTEGER , mult : SequenceMultiplicity . EXACTLY_ONE } ] ,
372372 ] ) ;
373373 it ( 'correctly counts add expressions' , ( ) => {
374- const ast = parseExpression ( '2 + 1' , { } ) ;
374+ const ast = parseExpression ( '2 + 1' , { version : 3.1 } ) ;
375375 annotateAst ( ast , new AnnotationContext ( undefined ) ) ;
376376 const [ total , annotated ] = countQueryBodyAnnotations ( ast ) ;
377377 chai . assert . equal ( total , annotated ) ;
378378 } ) ;
379379 it ( 'correctly counts unannotated expressions' , ( ) => {
380- const ast = parseExpression ( '$x + 1' , { } ) ;
380+ const ast = parseExpression ( '$x + 1' , { version : 3.1 } ) ;
381381 annotateAst ( ast , context ) ;
382382 const [ total , annotated ] = countQueryBodyAnnotations ( ast ) ;
383383 chai . assert . equal ( annotated , total ) ;
384384 chai . assert . equal ( total , 3 ) ;
385385 } ) ;
386386 it ( 'correctly counts unannotated expressions 2' , ( ) => {
387- const ast = parseExpression ( '$b + math:sin($a)' , { } ) ;
387+ const ast = parseExpression ( '$b + math:sin($a)' , { version : 3.1 } ) ;
388388 annotateAst ( ast , context ) ;
389389 const [ total , annotated ] = countQueryBodyAnnotations ( ast ) ;
390390 chai . assert . equal ( annotated , 2 ) ;
0 commit comments