Skip to content

Commit f6be2c7

Browse files
committed
fix BITCOUNT spec
1 parent 4de409e commit f6be2c7

File tree

1 file changed

+38
-35
lines changed

1 file changed

+38
-35
lines changed
Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
11
import { strict as assert } from 'assert';
22
import testUtils, { GLOBAL } from '../test-utils';
3-
import { transformArguments } from './BITCOUNT';
3+
import BITCOUNT from './BITCOUNT';
44

55
describe('BITCOUNT', () => {
6-
describe('transformArguments', () => {
7-
it('simple', () => {
8-
assert.deepEqual(
9-
transformArguments('key'),
10-
['BITCOUNT', 'key']
11-
);
12-
});
6+
describe('transformArguments', () => {
7+
it('simple', () => {
8+
assert.deepEqual(
9+
BITCOUNT.transformArguments('key'),
10+
['BITCOUNT', 'key']
11+
);
12+
});
1313

14-
describe('with range', () => {
15-
it('simple', () => {
16-
assert.deepEqual(
17-
transformArguments('key', {
18-
start: 0,
19-
end: 1
20-
}),
21-
['BITCOUNT', 'key', '0', '1']
22-
);
23-
});
14+
describe('with range', () => {
15+
it('simple', () => {
16+
assert.deepEqual(
17+
BITCOUNT.transformArguments('key', {
18+
start: 0,
19+
end: 1
20+
}),
21+
['BITCOUNT', 'key', '0', '1']
22+
);
23+
});
2424

25-
it('with mode', () => {
26-
assert.deepEqual(
27-
transformArguments('key', {
28-
start: 0,
29-
end: 1,
30-
mode: 'BIT'
31-
}),
32-
['BITCOUNT', 'key', '0', '1', 'BIT']
33-
);
34-
});
35-
});
25+
it('with mode', () => {
26+
assert.deepEqual(
27+
BITCOUNT.transformArguments('key', {
28+
start: 0,
29+
end: 1,
30+
mode: 'BIT'
31+
}),
32+
['BITCOUNT', 'key', '0', '1', 'BIT']
33+
);
34+
});
3635
});
36+
});
3737

38-
testUtils.testWithClient('client.bitCount', async client => {
39-
assert.equal(
40-
await client.bitCount('key'),
41-
0
42-
);
43-
}, GLOBAL.SERVERS.OPEN);
38+
testUtils.testAll('bitCount', async client => {
39+
assert.equal(
40+
await client.bitCount('key'),
41+
0
42+
);
43+
}, {
44+
client: GLOBAL.SERVERS.OPEN,
45+
cluster: GLOBAL.CLUSTERS.OPEN
46+
});
4447
});

0 commit comments

Comments
 (0)