Debian Codegraph @

packages/bloom/lib/commands/t-digest/index.spec.ts

raw symbols SCIP
1 import { strict as assert } from 'assert';
2 import { pushCompressionArgument, transformDoubleReply, transformDoublesReply } from '.';
3
4 describe('pushCompressionArgument', () => {
5 it('undefined', () => {
6 assert.deepEqual(
7 pushCompressionArgument([]),
8 []
9 );
10 });
11
12 it('100', () => {
13 assert.deepEqual(
14 pushCompressionArgument([], { COMPRESSION: 100 }),
15 ['COMPRESSION', '100']
16 );
17 });
18 });
19
20 describe('transformDoubleReply', () => {
21 it('inf', () => {
22 assert.equal(
23 transformDoubleReply('inf'),
24 Infinity
25 );
26 });
27
28 it('-inf', () => {
29 assert.equal(
30 transformDoubleReply('-inf'),
31 -Infinity
32 );
33 });
34
35 it('nan', () => {
36 assert.equal(
37 transformDoubleReply('nan'),
38 NaN
39 );
40 });
41
42 it('0', () => {
43 assert.equal(
44 transformDoubleReply('0'),
45 0
46 );
47 });
48 });
49
50 it('transformDoublesReply', () => {
51 assert.deepEqual(
52 transformDoublesReply(['inf', '-inf', 'nan', '0']),
53 [Infinity, -Infinity, NaN, 0]
54 );
55 });