Skip to content

Commit

Permalink
Add test for sql-js#76
Browse files Browse the repository at this point in the history
There is currently a bug in `api.coffee` that makes sql.js throw an
error when binding a null value to a statement.
  • Loading branch information
lovasoa committed Nov 26, 2014
1 parent 7b32cc2 commit b0aa738
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test_issue76.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
exports.test = function(sql, assert) {
// Create a database
var db = new sql.Database();
// Ultra-simple query
var stmt = db.prepare("VALUES (?)");
// Bind null to the parameter
stmt.bind([null]);

assert.deepEqual(stmt.get(), [null],
"binding a null value to a statement parameter");
db.close();
};

if (module == require.main) {
var sql = require('../js/sql.js');
var assert = require('assert');
exports.test(sql, assert);
}

0 comments on commit b0aa738

Please sign in to comment.