mirror of
https://github.com/phiresky/sql.js-httpvfs.git
synced 2024-11-08 20:22:44 +01:00
326ad43df3
subrepo: subdir: "sql.js" merged: "f5d9f54" upstream: origin: "https://github.com/sql-js/sql.js" branch: "master" commit: "f5d9f54" git-subrepo: version: "0.4.3" origin: "???" commit: "???"
27 lines
661 B
JavaScript
Vendored
27 lines
661 B
JavaScript
Vendored
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 and get the result
|
|
assert.deepEqual(stmt.get([null]), [null],
|
|
"binding a null value to a statement parameter");
|
|
db.close();
|
|
};
|
|
|
|
if (module == require.main) {
|
|
const target_file = process.argv[2];
|
|
const sql_loader = require('./load_sql_lib');
|
|
sql_loader(target_file).then((sql)=>{
|
|
require('test').run({
|
|
'test issue 76': function(assert){
|
|
exports.test(sql, assert);
|
|
}
|
|
});
|
|
})
|
|
.catch((e)=>{
|
|
console.error(e);
|
|
assert.fail(e);
|
|
});
|
|
}
|