You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
* wip * close #2216 - add support for TDIGEST.MERGESTORE and make compression optional on TDIGEST.CREATE * fix some tdigest commands, use bloom edge docker * fix index.ts * 2.4-RC2 (v2.4.1) * fix some commands and tests * clean code
56 lines
1.2 KiB
TypeScript
56 lines
1.2 KiB
TypeScript
import { strict as assert } from 'assert';
|
|
import { pushCompressionArgument, transformDoubleReply, transformDoublesReply } from '.';
|
|
|
|
describe('pushCompressionArgument', () => {
|
|
it('undefined', () => {
|
|
assert.deepEqual(
|
|
pushCompressionArgument([]),
|
|
[]
|
|
);
|
|
});
|
|
|
|
it('100', () => {
|
|
assert.deepEqual(
|
|
pushCompressionArgument([], { COMPRESSION: 100 }),
|
|
['COMPRESSION', '100']
|
|
);
|
|
});
|
|
});
|
|
|
|
describe('transformDoubleReply', () => {
|
|
it('inf', () => {
|
|
assert.equal(
|
|
transformDoubleReply('inf'),
|
|
Infinity
|
|
);
|
|
});
|
|
|
|
it('-inf', () => {
|
|
assert.equal(
|
|
transformDoubleReply('-inf'),
|
|
-Infinity
|
|
);
|
|
});
|
|
|
|
it('nan', () => {
|
|
assert.equal(
|
|
transformDoubleReply('nan'),
|
|
NaN
|
|
);
|
|
});
|
|
|
|
it('0', () => {
|
|
assert.equal(
|
|
transformDoubleReply('0'),
|
|
0
|
|
);
|
|
});
|
|
});
|
|
|
|
it('transformDoublesReply', () => {
|
|
assert.deepEqual(
|
|
transformDoublesReply(['inf', '-inf', 'nan', '0']),
|
|
[Infinity, -Infinity, NaN, 0]
|
|
);
|
|
});
|