You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
498 B

var test = require('tape');
var Codec = require('..');
test('key as buffer', function(t){
var codec = new Codec({ keyEncoding: 'hex' });
t.ok(codec.keyAsBuffer({}));
t.ok(codec.keyAsBuffer());
t.notOk(codec.keyAsBuffer({ keyEncoding: 'utf8' }));
t.end();
});
test('value as buffer', function(t){
var codec = new Codec({ valueEncoding: 'hex' });
t.ok(codec.valueAsBuffer({}));
t.ok(codec.valueAsBuffer());
t.notOk(codec.valueAsBuffer({ valueEncoding: 'utf8' }));
t.end();
});