Skip to content

Commit 2565e2e

Browse files
committed
Add test to check bind() with null parameter behavior
1 parent 9d81fad commit 2565e2e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/test_statement.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ exports.test = function(sql, assert){
6565
result = stmt.get({':start':1, ':end':1});
6666
assert.deepEqual(result, ['a',1], "Binding named parameters");
6767

68+
// Prepare statement, pass null to bind() and check that it works
69+
stmt = db.prepare("SELECT 'bind-with-null'");
70+
result = stmt.bind(null);
71+
assert.equal(result, true);
72+
stmt.step();
73+
result = stmt.get();
74+
assert.equal(result,"bind-with-null")
75+
6876
// Close the database and all associated statements
6977
db.close();
7078
};

0 commit comments

Comments
 (0)