abstract-leveldown
Advanced tools
Comparing version 2.0.3 to 2.1.0
@@ -78,3 +78,3 @@ var db | ||
, function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
@@ -84,9 +84,9 @@ // cycle open/close to ensure a pack to .sst | ||
db.close(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.open(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.approximateSize('!', '~', function (err, size) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
@@ -101,3 +101,3 @@ t.type(size, 'number') | ||
db.close(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.end() | ||
@@ -104,0 +104,0 @@ }) |
@@ -21,3 +21,3 @@ var db | ||
db.batch([{ type: 'put', key: 'foo1' }], function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.end() | ||
@@ -29,3 +29,3 @@ }) | ||
db.batch([{ type: 'put', key: 'foo1', value: null }], function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.end() | ||
@@ -85,3 +85,3 @@ }) | ||
db.batch([], null, function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.end() | ||
@@ -95,3 +95,3 @@ }) | ||
db.batch([], function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.end() | ||
@@ -103,6 +103,6 @@ }) | ||
db.batch([{ type: 'put', key: 'foo', value: 'bar' }], function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.get('foo', function (err, value) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
var result | ||
@@ -128,3 +128,3 @@ if (isTypedArray(value)) { | ||
], function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
@@ -138,3 +138,3 @@ var r = 0 | ||
db.get('foobatch1', function (err, value) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
var result | ||
@@ -159,3 +159,3 @@ if (isTypedArray(value)) { | ||
db.get('foobatch3', function (err, value) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
var result | ||
@@ -162,0 +162,0 @@ if (isTypedArray(value)) { |
@@ -166,3 +166,3 @@ var db | ||
, function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
@@ -179,7 +179,7 @@ db.batch() | ||
.write(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
testCommon.collectEntries( | ||
db.iterator({ keyAsBuffer: false, valueAsBuffer: false }) | ||
, function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 3, 'correct number of entries') | ||
@@ -186,0 +186,0 @@ var expected = [ |
@@ -6,3 +6,3 @@ module.exports.close = function (leveldown, test, testCommon) { | ||
db.open(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.throws( | ||
@@ -20,3 +20,3 @@ db.close.bind(db) | ||
db.close(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.end() | ||
@@ -23,0 +23,0 @@ }) |
@@ -45,5 +45,5 @@ var db | ||
db.put('foo', 'bar', function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.del('foo', function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.get('foo', function (err) { | ||
@@ -61,3 +61,3 @@ t.ok(err, 'entry propertly deleted') | ||
db.del('blargh', function (err) { | ||
t.notOk(err, 'should not error on delete') | ||
t.error(err) | ||
t.end() | ||
@@ -64,0 +64,0 @@ }) |
@@ -45,5 +45,5 @@ var db | ||
db.put('foo', 'bar', function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.get('foo', function (err, value) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.ok(typeof value !== 'string', 'should not be string by default') | ||
@@ -56,3 +56,7 @@ | ||
t.ok(typeof Buffer != 'undefined' && value instanceof Buffer) | ||
result = value.toString() | ||
try { | ||
result = value.toString() | ||
} catch (e) { | ||
t.error(e, 'should not throw when converting value to a string') | ||
} | ||
} | ||
@@ -63,3 +67,3 @@ | ||
db.get('foo', {}, function (err, value) { // same but with {} | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.ok(typeof value !== 'string', 'should not be string by default') | ||
@@ -72,3 +76,7 @@ | ||
t.ok(typeof Buffer != 'undefined' && value instanceof Buffer) | ||
result = value.toString() | ||
try { | ||
result = value.toString() | ||
} catch (e) { | ||
t.error(e, 'should not throw when converting value to a string') | ||
} | ||
} | ||
@@ -79,3 +87,3 @@ | ||
db.get('foo', { asBuffer: false }, function (err, value) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.ok(typeof value === 'string', 'should be string if not buffer') | ||
@@ -92,3 +100,3 @@ t.equal(value, 'bar') | ||
db.put('hello', 'world', function (err) { | ||
t.notOk(err, 'should not error') | ||
t.error(err) | ||
var r = 0 | ||
@@ -104,3 +112,3 @@ , done = function () { | ||
db.get('hello', function(err, value) { | ||
t.notOk(err, 'should not error') | ||
t.error(err) | ||
t.equal(value.toString(), 'world') | ||
@@ -107,0 +115,0 @@ done() |
@@ -69,3 +69,3 @@ var db | ||
iterator.end(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
iterator.end(function(err2) { | ||
@@ -83,3 +83,3 @@ t.ok(err2, 'returned error') | ||
iterator.end(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
iterator.next(function(err2) { | ||
@@ -97,5 +97,5 @@ t.ok(err2, 'returned error') | ||
iterator.next(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
iterator.end(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.end() | ||
@@ -123,6 +123,6 @@ }) | ||
db.batch(data, function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
var iterator = db.iterator() | ||
, fn = function (err, key, value) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
if (key && value) { | ||
@@ -168,3 +168,3 @@ t.ok(Buffer.isBuffer(key), 'key argument is a Buffer') | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, sourceData.length, 'correct number of entries') | ||
@@ -179,3 +179,3 @@ var expected = sourceData.map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, sourceData.length, 'correct number of entries') | ||
@@ -190,3 +190,3 @@ var expected = sourceData.slice().reverse().map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '00' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, sourceData.length, 'correct number of entries') | ||
@@ -201,3 +201,3 @@ var expected = sourceData.map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '50' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 50, 'correct number of entries') | ||
@@ -212,3 +212,3 @@ var expected = sourceData.slice(50).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '50', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 51, 'correct number of entries') | ||
@@ -223,3 +223,3 @@ var expected = sourceData.slice().reverse().slice(49).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '49.5' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 50, 'correct number of entries') | ||
@@ -234,3 +234,3 @@ var expected = sourceData.slice(50).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '49999' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 50, 'correct number of entries') | ||
@@ -245,3 +245,3 @@ var expected = sourceData.slice(50).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '49.5', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 50, 'correct number of entries') | ||
@@ -256,3 +256,3 @@ var expected = sourceData.slice().reverse().slice(50).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, end: '50' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 51, 'correct number of entries') | ||
@@ -267,3 +267,3 @@ var expected = sourceData.slice(0, 51).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, end: '50.5' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 51, 'correct number of entries') | ||
@@ -278,3 +278,3 @@ var expected = sourceData.slice(0, 51).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, end: '50555' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 51, 'correct number of entries') | ||
@@ -289,3 +289,3 @@ var expected = sourceData.slice(0, 51).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, end: '50.5', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 49, 'correct number of entries') | ||
@@ -301,3 +301,3 @@ var expected = sourceData.slice().reverse().slice(0, 49).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, end: '0' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 0, 'correct number of entries') | ||
@@ -310,3 +310,3 @@ t.end() | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '30', end: '70' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 41, 'correct number of entries') | ||
@@ -321,3 +321,3 @@ var expected = sourceData.slice(30, 71).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '70', end: '30', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 41, 'correct number of entries') | ||
@@ -332,3 +332,3 @@ var expected = sourceData.slice().reverse().slice(29, 70).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, limit: 20 }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 20, 'correct number of entries') | ||
@@ -343,3 +343,3 @@ var expected = sourceData.slice(0, 20).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '20', limit: 20 }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 20, 'correct number of entries') | ||
@@ -354,3 +354,3 @@ var expected = sourceData.slice(20, 40).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, limit: 20, reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 20, 'correct number of entries') | ||
@@ -365,3 +365,3 @@ var expected = sourceData.slice().reverse().slice(0, 20).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '79', limit: 20, reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 20, 'correct number of entries') | ||
@@ -377,3 +377,3 @@ var expected = sourceData.slice().reverse().slice(20, 40).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, limit: -1}), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, sourceData.length, 'correct number of entries') | ||
@@ -388,3 +388,3 @@ var expected = sourceData.map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, limit: 0 }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 0, 'correct number of entries') | ||
@@ -397,3 +397,3 @@ t.end() | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, limit: 20, end: '50' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 20, 'correct number of entries') | ||
@@ -408,3 +408,3 @@ var expected = sourceData.slice(0, 20).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, limit: 50, end: '19' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 20, 'correct number of entries') | ||
@@ -419,3 +419,3 @@ var expected = sourceData.slice(0, 20).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '9a' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 0, 'correct number of entries') | ||
@@ -428,3 +428,3 @@ t.end() | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, start: '9a', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, sourceData.length, 'correct number of entries') | ||
@@ -439,3 +439,3 @@ var expected = sourceData.slice().reverse().map(transformSource) | ||
collectEntries(db.iterator({ start: '9b', end: '9a', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 0, 'correct number of entries') | ||
@@ -451,3 +451,3 @@ t.end() | ||
collectEntries(db.iterator(iteratorOptions), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 100, 'correct number of entries') | ||
@@ -503,3 +503,3 @@ var expected = sourceData.map(transformSource) | ||
iterator.next(function (err, key, value) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.ok(key, 'got a key') | ||
@@ -506,0 +506,0 @@ t.equal(key.toString(), 'foobatch1', 'correct key') |
@@ -33,3 +33,3 @@ module.exports.setUp = function (test, testCommon) { | ||
db.open(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.close(function () { | ||
@@ -46,3 +46,3 @@ t.end() | ||
db.open({}, function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.close(function () { | ||
@@ -57,7 +57,7 @@ t.end() | ||
db.open(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.close(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.open(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.close(function () { | ||
@@ -89,5 +89,5 @@ t.end() | ||
db.open({}, function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.close(function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
@@ -94,0 +94,0 @@ // open again with 'errorIfExists' |
@@ -46,3 +46,3 @@ /**** SETUP & UTILITY STUFF ****/ | ||
db.get(key, function (err, _value) { | ||
t.notOk(err, 'no error, has key/value for `' + type + '`') | ||
t.error(err, 'no error, has key/value for `' + type + '`') | ||
t.ok(Buffer.isBuffer(_value), 'is a Buffer') | ||
@@ -60,3 +60,3 @@ var result = _value | ||
db.del(key, function (err) { | ||
t.notOk(err, 'no error, deleted key/value for `' + type + '`') | ||
t.error(err, 'no error, deleted key/value for `' + type + '`') | ||
db.get(key, function (err, value) { | ||
@@ -63,0 +63,0 @@ t.ok(err, 'entry propertly deleted') |
@@ -54,5 +54,5 @@ var db | ||
db.put('foo', 'bar', function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.get('foo', function (err, value) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
var result = value.toString() | ||
@@ -70,5 +70,5 @@ if (isTypedArray(value)) | ||
db.put('dood', {pete: 'sampras'}, function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
db.get('dood', { asBuffer: false }, function (err, value) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(JSON.stringify(value), JSON.stringify({pete: 'sampras'})) | ||
@@ -75,0 +75,0 @@ t.end() |
@@ -23,6 +23,6 @@ var db | ||
db.batch(data, function (err) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
var iterator = db.iterator() | ||
, fn = function (err, key, value) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
if (key && value) { | ||
@@ -66,3 +66,3 @@ t.equal(key.toString(), data[idx].key, 'correct key') | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, sourceData.length, 'correct number of entries') | ||
@@ -77,3 +77,3 @@ var expected = sourceData.map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, sourceData.length, 'correct number of entries') | ||
@@ -88,3 +88,3 @@ var expected = sourceData.slice().reverse().map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gte: '00' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, sourceData.length, 'correct number of entries') | ||
@@ -99,3 +99,3 @@ var expected = sourceData.map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gte: '50' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 50, 'correct number of entries') | ||
@@ -110,3 +110,3 @@ var expected = sourceData.slice(50).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lte: '50', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 51, 'correct number of entries') | ||
@@ -121,3 +121,3 @@ var expected = sourceData.slice().reverse().slice(49).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gte: '49.5' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 50, 'correct number of entries') | ||
@@ -132,3 +132,3 @@ var expected = sourceData.slice(50).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gte: '49999' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 50, 'correct number of entries') | ||
@@ -143,3 +143,3 @@ var expected = sourceData.slice(50).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lte: '49.5', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 50, 'correct number of entries') | ||
@@ -154,3 +154,3 @@ var expected = sourceData.slice().reverse().slice(50).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lt: '49.5', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 50, 'correct number of entries') | ||
@@ -165,3 +165,3 @@ var expected = sourceData.slice().reverse().slice(50).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lt: '50', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 50, 'correct number of entries') | ||
@@ -176,3 +176,3 @@ var expected = sourceData.slice().reverse().slice(50).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lte: '50' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 51, 'correct number of entries') | ||
@@ -187,3 +187,3 @@ var expected = sourceData.slice(0, 51).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lte: '50.5' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 51, 'correct number of entries') | ||
@@ -198,3 +198,3 @@ var expected = sourceData.slice(0, 51).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lte: '50555' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 51, 'correct number of entries') | ||
@@ -209,3 +209,3 @@ var expected = sourceData.slice(0, 51).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lt: '50555' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 51, 'correct number of entries') | ||
@@ -220,3 +220,3 @@ var expected = sourceData.slice(0, 51).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gte: '50.5', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 49, 'correct number of entries') | ||
@@ -231,3 +231,3 @@ var expected = sourceData.slice().reverse().slice(0, 49).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gt: '50.5', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 49, 'correct number of entries') | ||
@@ -242,3 +242,3 @@ var expected = sourceData.slice().reverse().slice(0, 49).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gt: '50', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 49, 'correct number of entries') | ||
@@ -253,3 +253,3 @@ var expected = sourceData.slice().reverse().slice(0, 49).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gt: '50', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 49, 'correct number of entries') | ||
@@ -265,3 +265,3 @@ var expected = sourceData.slice().reverse().slice(0, 49).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lte: '0' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 0, 'correct number of entries') | ||
@@ -275,3 +275,3 @@ t.end() | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lt: '0' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 0, 'correct number of entries') | ||
@@ -284,3 +284,3 @@ t.end() | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gte: '30', lte: '70' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 41, 'correct number of entries') | ||
@@ -295,3 +295,3 @@ var expected = sourceData.slice(30, 71).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gt: '29', lt: '71' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 41, 'correct number of entries') | ||
@@ -306,3 +306,3 @@ var expected = sourceData.slice(30, 71).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lte: '70', gte: '30', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 41, 'correct number of entries') | ||
@@ -317,3 +317,3 @@ var expected = sourceData.slice().reverse().slice(29, 70).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lt: '71', gt: '29', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 41, 'correct number of entries') | ||
@@ -328,3 +328,3 @@ var expected = sourceData.slice().reverse().slice(29, 70).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gte: '20', limit: 20 }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 20, 'correct number of entries') | ||
@@ -339,3 +339,3 @@ var expected = sourceData.slice(20, 40).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lte: '79', limit: 20, reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 20, 'correct number of entries') | ||
@@ -350,3 +350,3 @@ var expected = sourceData.slice().reverse().slice(20, 40).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, limit: 20, lte: '50' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 20, 'correct number of entries') | ||
@@ -361,3 +361,3 @@ var expected = sourceData.slice(0, 20).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, limit: 50, lte: '19' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 20, 'correct number of entries') | ||
@@ -372,3 +372,3 @@ var expected = sourceData.slice(0, 20).map(transformSource) | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gte: '9a' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 0, 'correct number of entries') | ||
@@ -381,3 +381,3 @@ t.end() | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, gt: '9a' }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 0, 'correct number of entries') | ||
@@ -390,3 +390,3 @@ t.end() | ||
collectEntries(db.iterator({ keyAsBuffer: false, valueAsBuffer: false, lte: '9a', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, sourceData.length, 'correct number of entries') | ||
@@ -401,3 +401,3 @@ var expected = sourceData.slice().reverse().map(transformSource) | ||
collectEntries(db.iterator({ lte: '9b', gte: '9a', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 0, 'correct number of entries') | ||
@@ -410,3 +410,3 @@ t.end() | ||
collectEntries(db.iterator({ lt: '9b', gt: '9a', reverse: true }), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 0, 'correct number of entries') | ||
@@ -422,3 +422,3 @@ t.end() | ||
collectEntries(db.iterator(iteratorOptions), function (err, data) { | ||
t.notOk(err, 'no error') | ||
t.error(err) | ||
t.equal(data.length, 100, 'correct number of entries') | ||
@@ -425,0 +425,0 @@ var expected = sourceData.map(transformSource) |
{ | ||
"name": "abstract-leveldown", | ||
"description": "An abstract prototype matching the LevelDOWN API", | ||
"version": "2.0.3", | ||
"version": "2.1.0", | ||
"contributors": [ | ||
@@ -6,0 +6,0 @@ "Rod Vagg <r@va.gg> (https://github.com/rvagg)", |
@@ -151,2 +151,3 @@ # Abstract LevelDOWN [![Build Status](https://secure.travis-ci.org/rvagg/abstract-leveldown.png)](http://travis-ci.org/rvagg/abstract-leveldown) | ||
<tr><th align="left">James Halliday</th><td><a href="https://github.com/substack">GitHub/substack</a></td><td><a href="https://twitter.com/substack">Twitter/@substack</a></td></tr> | ||
<tr><th align="left">Thomas Watson Steen</th><td><a href="https://github.com/watson">GitHub/watson</a></td><td><a href="https://twitter.com/wa7son">Twitter/@wa7son</a></td></tr> | ||
</tbody></table> | ||
@@ -153,0 +154,0 @@ |
@@ -42,3 +42,3 @@ var path = require('path') | ||
cleanup(function (err) { | ||
t.notOk(err, 'cleanup returned an error') | ||
t.error(err, 'cleanup returned an error') | ||
t.end() | ||
@@ -63,3 +63,3 @@ }) | ||
data.push({ key: key, value: value }) | ||
process.nextTick(next) | ||
setTimeout(next, 0) | ||
}) | ||
@@ -66,0 +66,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2642
161
114004