Closed chrbala closed 6 years ago
The iterator does not go in the correct direction with both an upper and lower bound.
https://github.com/chrbala/lmdb-leveldown/blob/5d3480022666de54d6f7114277db08803db7740e/src/index.js#L256
Example test output:
# test iterator with gte=30 and lte=70 and reverse=true ok 275 undefined not ok 276 correct number of entries --- operator: equal expected: 41 actual: 1 stack: |- Error: correct number of entries at Test.assert [as _assert] (/Users/chris/lmdb-leveldown/node_modules/tape/lib/test.js:212:54) at Test.bound [as _assert] (/Users/chris/lmdb-leveldown/node_modules/tape/lib/test.js:64:32) at Test.equal.Test.equals.Test.isEqual.Test.is.Test.strictEqual.Test.strictEquals (/Users/chris/lmdb-leveldown/node_modules/tape/lib/test.js:347:10) at Test.bound [as is] (/Users/chris/lmdb-leveldown/node_modules/tape/lib/test.js:64:32) at /Users/chris/lmdb-leveldown/node_modules/abstract-leveldown/abstract/iterator-range-test.js:28:11 at /Users/chris/lmdb-leveldown/node_modules/abstract-leveldown/testCommon.js:56:11 at /Users/chris/lmdb-leveldown/src/index.js:281:48 ... not ok 277 should be equivalent --- operator: deepEqual expected: |- [ { key: '70', value: '0.8025281173721805' }, { key: '69', value: '0.5664507517525017' }, { key: '68', value: '0.10233997012150153' }, { key: '67', value: '0.3480505763258064' }, { key: '66', value: '0.9132791307734551' }, { key: '65', value: '0.030064742250546006' }, { key: '64', value: '0.49373167690324027' }, { key: '63', value: '0.12620420026129908' }, { key: '62', value: '0.11216823705999612' }, { key: '61', value: '0.42510185325347893' }, { key: '60', value: '0.9624005486051628' }, { key: '59', value: '0.5568737819443985' }, { key: '58', value: '0.5319237025637298' }, { key: '57', value: '0.8552353376818715' }, { key: '56', value: '0.6401857734726797' }, { key: '55', value: '0.7778772324231' }, { key: '54', value: '0.6563670401821771' }, { key: '53', value: '0.4460314320292509' }, { key: '52', value: '0.07948485238433345' }, { key: '51', value: '0.36530754007971344' }, { key: '50', value: '0.9926293454942214' }, { key: '49', value: '0.870681776044933' }, { key: '48', value: '0.40817687400102187' }, { key: '47', value: '0.3876517750820454' }, { key: '46', value: '0.0017991566460582309' }, { key: '45', value: '0.8344979460196531' }, { key: '44', value: '0.2520268489645723' }, { key: '43', value: '0.8325248425789715' }, { key: '42', value: '0.001318505225654354' }, { key: '41', value: '0.6002752426781577' }, { key: '40', value: '0.9062894500219179' }, { key: '39', value: '0.5091017741121526' }, { key: '38', value: '0.556665716180794' }, { key: '37', value: '0.6994867761581447' }, { key: '36', value: '0.6354089503475413' }, { key: '35', value: '0.3067917310062098' }, { key: '34', value: '0.9483960001944651' }, { key: '33', value: '0.07456138004585422' }, { key: '32', value: '0.5269703145924365' }, { key: '31', value: '0.11930046918457604' }, { key: '30', value: '0.95193243077822' } ] actual: |- [ { key: '30', value: '0.95193243077822' } ] stack: |- Error: should be equivalent at Test.assert [as _assert] (/Users/chris/lmdb-leveldown/node_modules/tape/lib/test.js:212:54) at Test.bound [as _assert] (/Users/chris/lmdb-leveldown/node_modules/tape/lib/test.js:64:32) at Test.deepEqual.Test.deepEquals.Test.isEquivalent.Test.same (/Users/chris/lmdb-leveldown/node_modules/tape/lib/test.js:380:10) at Test.bound [as same] (/Users/chris/lmdb-leveldown/node_modules/tape/lib/test.js:64:32) at /Users/chris/lmdb-leveldown/node_modules/abstract-leveldown/abstract/iterator-range-test.js:29:11 at /Users/chris/lmdb-leveldown/node_modules/abstract-leveldown/testCommon.js:56:11 at /Users/chris/lmdb-leveldown/src/index.js:281:48 ...
The iterator does not go in the correct direction with both an upper and lower bound.
https://github.com/chrbala/lmdb-leveldown/blob/5d3480022666de54d6f7114277db08803db7740e/src/index.js#L256
Example test output: