1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00
This commit is contained in:
Leibale
2023-06-19 18:04:31 -04:00
parent 9c1f2a0f86
commit f150e86f95
47 changed files with 2490 additions and 1798 deletions

View File

@@ -1,29 +1,29 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import { MATH_FUNCTION, loadMathFunction } from '../client/index.spec';
import { transformArguments } from './FCALL_RO';
import { MATH_FUNCTION, loadMathFunction } from './FUNCTION_LOAD.spec';
import FCALL_RO from './FCALL_RO';
describe('FCALL_RO', () => {
testUtils.isVersionGreaterThanHook([7]);
testUtils.isVersionGreaterThanHook([7]);
it('transformArguments', () => {
assert.deepEqual(
transformArguments('function', {
keys: ['key'],
arguments: ['argument']
}),
['FCALL_RO', 'function', '1', 'key', 'argument']
);
});
it('transformArguments', () => {
assert.deepEqual(
FCALL_RO.transformArguments('function', {
keys: ['key'],
arguments: ['argument']
}),
['FCALL_RO', 'function', '1', 'key', 'argument']
);
});
testUtils.testWithClient('client.fCallRo', async client => {
await loadMathFunction(client);
testUtils.testWithClient('client.fCallRo', async client => {
await loadMathFunction(client);
assert.equal(
await client.fCallRo(MATH_FUNCTION.library.square.NAME, {
arguments: ['2']
}),
4
);
}, GLOBAL.SERVERS.OPEN);
assert.equal(
await client.fCallRo(MATH_FUNCTION.library.square.NAME, {
arguments: ['2']
}),
4
);
}, GLOBAL.SERVERS.OPEN);
});