(conf)
| 9 | }); |
| 10 | |
| 11 | function main(conf) { |
| 12 | const db = new sqlite.DatabaseSync(':memory:'); |
| 13 | |
| 14 | if (conf.transaction === 'true') { |
| 15 | db.exec('BEGIN'); |
| 16 | } |
| 17 | |
| 18 | let i; |
| 19 | let deadCodeElimination = true; |
| 20 | |
| 21 | bench.start(); |
| 22 | for (i = 0; i < conf.n; i += 1) |
| 23 | deadCodeElimination &&= db.isTransaction; |
| 24 | bench.end(conf.n); |
| 25 | |
| 26 | assert.ok(deadCodeElimination === (conf.transaction === 'true')); |
| 27 | |
| 28 | if (conf.transaction === 'true') { |
| 29 | db.exec('ROLLBACK'); |
| 30 | } |
| 31 | } |