@@ -676,22 +676,22 @@ describe('utils', () => {
676676    } ) ; 
677677  } ) ; 
678678
679-   describe ( 'findJsonAccesses ' ,  ( )  =>  { 
679+   describe ( 'findJsonExpressions ' ,  ( )  =>  { 
680680    it ( 'should handle empty expression' ,  ( )  =>  { 
681681      const  sql  =  '' ; 
682682      const  actual  =  findJsonExpressions ( sql ) ; 
683683      const  expected  =  [ ] ; 
684684      expect ( actual ) . toEqual ( expected ) ; 
685685    } ) ; 
686686
687-     it ( 'should find a single JSON access ' ,  ( )  =>  { 
687+     it ( 'should find a single JSON expression ' ,  ( )  =>  { 
688688      const  sql  =  'SELECT a.b.c as alias1, col2 as alias2 FROM table' ; 
689689      const  actual  =  findJsonExpressions ( sql ) ; 
690690      const  expected  =  [ {  index : 7 ,  expr : 'a.b.c'  } ] ; 
691691      expect ( actual ) . toEqual ( expected ) ; 
692692    } ) ; 
693693
694-     it ( 'should find multiple JSON access ' ,  ( )  =>  { 
694+     it ( 'should find multiple JSON expression ' ,  ( )  =>  { 
695695      const  sql  =  'SELECT a.b.c, d.e, col2 FROM table' ; 
696696      const  actual  =  findJsonExpressions ( sql ) ; 
697697      const  expected  =  [ 
@@ -701,14 +701,14 @@ describe('utils', () => {
701701      expect ( actual ) . toEqual ( expected ) ; 
702702    } ) ; 
703703
704-     it ( 'should find JSON access  with type specifier' ,  ( )  =>  { 
704+     it ( 'should find JSON expression  with type specifier' ,  ( )  =>  { 
705705      const  sql  =  'SELECT a.b.:UInt64, col2 FROM table' ; 
706706      const  actual  =  findJsonExpressions ( sql ) ; 
707707      const  expected  =  [ {  index : 7 ,  expr : 'a.b.:UInt64'  } ] ; 
708708      expect ( actual ) . toEqual ( expected ) ; 
709709    } ) ; 
710710
711-     it ( 'should find JSON access  with complex type specifier' ,  ( )  =>  { 
711+     it ( 'should find JSON expression  with complex type specifier' ,  ( )  =>  { 
712712      const  sql  =  'SELECT a.b.:Array(String)  , col2 FROM table' ; 
713713      const  actual  =  findJsonExpressions ( sql ) ; 
714714      const  expected  =  [ {  index : 7 ,  expr : 'a.b.:Array(String)'  } ] ; 
@@ -850,6 +850,20 @@ describe('utils', () => {
850850      const  expected  =  [ {  index : 10 ,  expr : 'a.b.c'  } ] ; 
851851      expect ( actual ) . toEqual ( expected ) ; 
852852    } ) ; 
853+ 
854+     it ( 'should not find a decimal number expression' ,  ( )  =>  { 
855+       const  sql  =  'SELECT 10.50, 2.3, 2, 1.5 - a.b FROM table' ; 
856+       const  actual  =  findJsonExpressions ( sql ) ; 
857+       const  expected  =  [ {  index : 28 ,  expr : 'a.b'  } ] ; 
858+       expect ( actual ) . toEqual ( expected ) ; 
859+     } ) ; 
860+ 
861+     it ( 'should not find a . as a JSON expression' ,  ( )  =>  { 
862+       const  sql  =  'SELECT . FROM table' ; 
863+       const  actual  =  findJsonExpressions ( sql ) ; 
864+       const  expected  =  [ ] ; 
865+       expect ( actual ) . toEqual ( expected ) ; 
866+     } ) ; 
853867  } ) ; 
854868
855869  describe ( 'replaceJsonAccesses' ,  ( )  =>  { 
0 commit comments