Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 2be3d50

Browse files
committed
More cds.ql cleanup
1 parent 46b58f1 commit 2be3d50

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

test/cds.ql.test.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)