Skip to content

Commit edef77a

Browse files
committed
test: handle unusual chars
1 parent d1b44a1 commit edef77a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/parallel/test-sqlite-database-sync.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,9 @@ suite('DatabaseSync.prototype.location()', () => {
405405
const other = new DatabaseSync(dbPath);
406406
t.after(() => { other.close(); });
407407

408-
db.exec(`ATTACH DATABASE '${otherPath}' AS other`);
408+
// Adding this escape because the test with unusual chars have a single quote which breaks the query
409+
const escapedPath = otherPath.replace("'", "''");
410+
db.exec(`ATTACH DATABASE '${escapedPath}' AS other`);
409411

410412
t.assert.equal(db.location('other'), otherPath);
411413
});

0 commit comments

Comments
 (0)