(conf)
| 14 | }); |
| 15 | |
| 16 | function main(conf) { |
| 17 | const optionsObj = conf.options === 'none' ? {} : conf.options.split('|').reduce((acc, key) => { |
| 18 | acc[key] = true; |
| 19 | return acc; |
| 20 | }, {}); |
| 21 | |
| 22 | const db = new sqlite.DatabaseSync(':memory:', optionsObj); |
| 23 | |
| 24 | db.exec( |
| 25 | 'CREATE TABLE foo (text_column TEXT, integer_column INTEGER, real_column REAL, blob_column BLOB)', |
| 26 | ); |
| 27 | |
| 28 | const fooInsertStatement = db.prepare( |
| 29 | 'INSERT INTO foo (text_column, integer_column, real_column, blob_column) VALUES (?, ?, ?, ?)', |
| 30 | ); |
| 31 | |
| 32 | for (let i = 0; i < conf.tableSeedSize; i++) { |
| 33 | fooInsertStatement.run( |
| 34 | crypto.randomUUID(), |
| 35 | Math.floor(Math.random() * 100), |
| 36 | Math.random(), |
| 37 | Buffer.from('example blob data'), |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | let i; |
| 42 | let deadCodeElimination; |
| 43 | |
| 44 | const stmt = db.prepare(conf.statement); |
| 45 | |
| 46 | bench.start(); |
| 47 | for (i = 0; i < conf.n; i += 1) deadCodeElimination = stmt.all(); |
| 48 | bench.end(conf.n); |
| 49 | |
| 50 | assert.ok(deadCodeElimination !== undefined); |
| 51 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…