Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.
/ party Public archive

Commit 93f1300

Browse files
author
James Halliday
committed
read stream tho
1 parent f0d7f73 commit 93f1300

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

test/bytewise.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,25 @@ var datadir = path.join(tmpdir, 'level-party-' + Math.random());
88

99
var lopts = { keyEncoding: bytewise, valueEncoding: 'json' };
1010

11-
test('two handles', function (t) {
12-
t.plan(1);
11+
test('bytewise key encoding', function (t) {
12+
t.plan(5);
1313
var adb = level(datadir, lopts);
1414
var bdb = level(datadir, lopts);
1515
var value = Math.floor(Math.random() * 100000);
1616

1717
adb.put([ 'a' ], value, function (err) {
18-
if (err) t.fail(err);
18+
t.ifError(err);
1919
var times = 0;
2020

2121
bdb.get([ 'a' ], function (err, x) {
22+
t.ifError(err);
2223
t.equal(x, value);
2324
});
25+
26+
bdb.createReadStream().on('data', function (row) {
27+
t.deepEqual(row.key, [ 'a' ]);
28+
t.deepEqual(row.value, value);
29+
});
2430
});
2531

2632
t.on('end', function () {

0 commit comments

Comments
 (0)