Skip to content

Commit 4db0827

Browse files
committed
Add test for trailing comments
1 parent bd8b2b5 commit 4db0827

File tree

1 file changed

+14
-0
lines changed
  • packages/datasources/duckdb/test

1 file changed

+14
-0
lines changed

packages/datasources/duckdb/test/test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,20 @@ test('query batches results properly', async () => {
398398
}
399399
});
400400

401+
test('handles trailing comments', async () => {
402+
// Single-line trailing comment (run in-memory)
403+
const q1 = 'select 1 as one -- trailing comment';
404+
const { rows: rowGen1 } = await runQuery(q1, undefined);
405+
const rows1 = await batchedAsyncGeneratorToArray(rowGen1);
406+
assert.equal(rows1[0].one, 1);
407+
408+
// Block trailing comment
409+
const q2 = 'select 2 as two /* trailing block comment */';
410+
const { rows: rowGen2 } = await runQuery(q2, undefined);
411+
const rows2 = await batchedAsyncGeneratorToArray(rowGen2);
412+
assert.equal(rows2[0].two, 2);
413+
});
414+
401415
test('handles leading SET statements before main query', async () => {
402416
try {
403417
const query = `

0 commit comments

Comments
 (0)