| 1 | import { strict as assert } from 'assert'; |
| 2 | import testUtils, { GLOBAL } from '../../test-utils'; |
| 3 | import { transformArguments } from './RANK'; |
| 4 | |
| 5 | describe('TDIGEST.RANK', () => { |
| 6 | it('transformArguments', () => { |
| 7 | assert.deepEqual( |
| 8 | transformArguments('key', [1, 2]), |
| 9 | ['TDIGEST.RANK', 'key', '1', '2'] |
| 10 | ); |
| 11 | }); |
| 12 | |
| 13 | testUtils.testWithClient('client.tDigest.rank', async client => { |
| 14 | const [ , reply ] = await Promise.all([ |
| 15 | client.tDigest.create('key'), |
| 16 | client.tDigest.rank('key', [1]) |
| 17 | ]); |
| 18 | |
| 19 | assert.deepEqual(reply, [-2]); |
| 20 | }, GLOBAL.SERVERS.OPEN); |
| 21 | }); |