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.
26 lines
532 B
26 lines
532 B
var test = require('tape'); |
|
var Codec = require('..'); |
|
|
|
test('encode ltgt', function(t){ |
|
var codec = new Codec({ keyEncoding: 'hex' }); |
|
|
|
var ltgt = { |
|
start: '686579', |
|
lte: '686579' |
|
}; |
|
var encoded = codec.encodeLtgt(ltgt); |
|
t.equal(encoded.start.toString(), 'hey'); |
|
t.equal(encoded.lte.toString(), 'hey'); |
|
|
|
ltgt = { |
|
start: '686579', |
|
lte: '686579', |
|
keyEncoding: 'json' |
|
}; |
|
encoded = codec.encodeLtgt(ltgt); |
|
t.equal(encoded.start, '"686579"'); |
|
t.equal(encoded.lte, '"686579"'); |
|
|
|
t.end(); |
|
}); |
|
|
|
|