@@ -246,19 +246,18 @@ describe('Statement#iterate()', function () {
246
246
this . db . prepare ( SQL1 ) . iterate ( 'foo' , 1 , new ( function ( ) { } ) ( ) , Buffer . alloc ( 4 ) . fill ( 0xdd ) , null )
247
247
) . to . throw ( TypeError ) ;
248
248
} ) ;
249
-
250
249
it ( "should read and write non-trivial numbers of rows" , function ( ) {
251
250
const insertRuntime = 1000
252
251
this . timeout ( insertRuntime * 2.5 ) ;
253
252
const runUntil = Date . now ( ) + insertRuntime
254
- let i = 0 ;
253
+ let i = 0 ;
255
254
const r = .141592654
256
- this . db . prepare ( 'CREATE TABLE t (id INTEGER, b TEXT, c REAL)' ) . run ( ) ;
255
+ this . db . prepare ( 'CREATE TABLE t (id INTEGER, b TEXT, c REAL)' ) . run ( ) ;
257
256
const stmt = this . db . prepare ( "INSERT INTO t VALUES (?, ?, ?)" ) ;
258
- while ( Date . now ( ) < runUntil ) {
257
+ while ( Date . now ( ) < runUntil ) {
259
258
// Batched transactions of 100 inserts:
260
259
this . db . transaction ( ( ) => {
261
- for ( const start = i ; i < start + 100 ; i ++ ) {
260
+ for ( const start = i ; i < start + 100 ; i ++ ) {
262
261
expect ( stmt . run ( [ i , String ( i ) , i + r ] ) ) . to . deep . equal ( {
263
262
changes : 1 ,
264
263
lastInsertRowid : i + 1
@@ -267,15 +266,15 @@ describe('Statement#iterate()', function () {
267
266
} ) ( ) ;
268
267
}
269
268
expect ( i ) . to . be . gte ( 1000 ) ; // < expect ~50K and 200K on reasonable machines
270
- const stmt1 = this . db . prepare ( "SELECT * FROM t ORDER BY id DESC" ) ;
271
- for ( const data of stmt1 . iterate ( ) ) {
269
+ const stmt1 = this . db . prepare ( "SELECT * FROM t ORDER BY id DESC" ) ;
270
+ for ( const data of stmt1 . iterate ( ) ) {
272
271
i --
273
- expect ( data ) . to . deep . equal ( {
274
- id : i ,
275
- b : String ( i ) ,
276
- c : i + r
277
- } )
278
- }
279
- expect ( i ) . to . equal ( 0 )
272
+ expect ( data ) . to . deep . equal ( {
273
+ id : i ,
274
+ b : String ( i ) ,
275
+ c : i + r
276
+ } )
277
+ }
278
+ expect ( i ) . to . equal ( 0 )
280
279
} ) ;
281
280
} ) ;
0 commit comments