Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Added test for valueEncoding "hex" for createReadStream
Browse files Browse the repository at this point in the history
  • Loading branch information
Braydon Fuller committed Apr 28, 2015
1 parent 2857d50 commit 9576842
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/read-stream-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,27 @@ buster.testCase('ReadStream', {
}.bind(this))
}

, 'test hex encoding': function (done) {
var options = { createIfMissing: true, errorIfExists: true, keyEncoding: 'utf8', valueEncoding: 'hex'}
, data = [
{ type: 'put', key: 'ab', value: 'abcdef0123456789' }
]

this.openTestDatabase({}, function (db) {
db.batch(data.slice(), options, function (err) {
refute(err);

var rs = db.createReadStream(options)
rs.on('data' , function(data) {
assert.equals(data.value, 'abcdef0123456789');
})
rs.on('end' , this.endSpy)
rs.on('close', done)

}.bind(this))
}.bind(this));
}

, 'test json encoding': function (done) {
var options = { createIfMissing: true, errorIfExists: true, keyEncoding: 'utf8', valueEncoding: 'json' }
, data = [
Expand Down

0 comments on commit 9576842

Please sign in to comment.