@@ -13,9 +13,10 @@ describe('cds.ql → cqn', () => {
1313 //
1414 let cqn
1515
16- describe . skip ( `BUGS + GAPS ...`, ( ) => {
16+ describe ( `SELECT ...`, ( ) => {
1717
1818 it ( 'should consistently handle *' , ( ) => {
19+ if ( ! cdr ) return
1920 expect ( {
2021 SELECT : { from : { ref : [ 'Foo' ] } , columns : [ '*' ] } ,
2122 } )
@@ -25,19 +26,6 @@ describe('cds.ql → cqn', () => {
2526 . to . eql ( SELECT . from ( Foo , [ '*' ] ) )
2627 } )
2728
28-
29- it ( 'should consistently handle lists' , ( ) => {
30- const ID = 11 , args = [ `foo` , "'bar'" , 3 ]
31- const cqn = CQL `SELECT from Foo where ID=11 and x in (foo,'bar',3)`
32- expect ( SELECT . from ( Foo ) . where ( `ID=${ ID } and x in (${ args } )` ) ) . to . eql ( cqn )
33- expect ( SELECT . from ( Foo ) . where ( `ID=` , ID , `and x in` , args ) ) . to . eql ( cqn )
34- expect ( SELECT . from ( Foo ) . where ( { ID , x :args } ) ) . to . eql ( cqn )
35- } )
36-
37- } )
38-
39-
40- describe ( `SELECT...` , ( ) => {
4129 test ( 'from ( Foo )' , ( ) => {
4230 expect ( {
4331 SELECT : { from : { ref : [ 'Foo' ] } } ,
@@ -390,6 +378,15 @@ describe('cds.ql → cqn', () => {
390378 )
391379 } )
392380
381+ it ( 'should consistently handle lists' , ( ) => {
382+ if ( ! cdr ) return
383+ const ID = 11 , args = [ { ref :[ 'foo' ] } , "bar" , 3 ]
384+ const cqn = CQL `SELECT from Foo where ID=11 and x in (foo,'bar',3)`
385+ expect ( SELECT . from ( Foo ) . where `ID=${ ID } and x in ${ args } ` ) . to . eql ( cqn )
386+ expect ( SELECT . from ( Foo ) . where ( `ID=` , ID , `and x in` , args ) ) . to . eql ( cqn )
387+ expect ( SELECT . from ( Foo ) . where ( { ID , x :args } ) ) . to . eql ( cqn )
388+ } )
389+
393390 test ( 'w/ sub selects' , ( ) => {
394391 // in where causes
395392 expect ( SELECT . from ( Foo ) . where ( { x : SELECT ( 'y' ) . from ( 'Bar' ) } ) ) . to . eql (
0 commit comments