Skip to content

Commit d5ef578

Browse files
committed
fix BITPOS spec
1 parent f6be2c7 commit d5ef578

File tree

1 file changed

+36
-40
lines changed

1 file changed

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

5-
describe('BITPOS', () => {
6-
describe('transformArguments', () => {
7-
it('simple', () => {
8-
assert.deepEqual(
9-
transformArguments('key', 1),
10-
['BITPOS', 'key', '1']
11-
);
12-
});
13-
14-
it('with start', () => {
15-
assert.deepEqual(
16-
transformArguments('key', 1, 1),
17-
['BITPOS', 'key', '1', '1']
18-
);
19-
});
5+
describe.only('BITPOS', () => {
6+
describe('transformArguments', () => {
7+
it('simple', () => {
8+
assert.deepEqual(
9+
BITPOS.transformArguments('key', 1),
10+
['BITPOS', 'key', '1']
11+
);
12+
});
2013

21-
it('with start and end', () => {
22-
assert.deepEqual(
23-
transformArguments('key', 1, 1, -1),
24-
['BITPOS', 'key', '1', '1', '-1']
25-
);
26-
});
14+
it('with start', () => {
15+
assert.deepEqual(
16+
BITPOS.transformArguments('key', 1, 1),
17+
['BITPOS', 'key', '1', '1']
18+
);
19+
});
2720

28-
it('with start, end and mode', () => {
29-
assert.deepEqual(
30-
transformArguments('key', 1, 1, -1, 'BIT'),
31-
['BITPOS', 'key', '1', '1', '-1', 'BIT']
32-
);
33-
});
21+
it('with start and end', () => {
22+
assert.deepEqual(
23+
BITPOS.transformArguments('key', 1, 1, -1),
24+
['BITPOS', 'key', '1', '1', '-1']
25+
);
3426
});
3527

36-
testUtils.testWithClient('client.bitPos', async client => {
37-
assert.equal(
38-
await client.bitPos('key', 1, 1),
39-
-1
40-
);
41-
}, GLOBAL.SERVERS.OPEN);
28+
it('with start, end and mode', () => {
29+
assert.deepEqual(
30+
BITPOS.transformArguments('key', 1, 1, -1, 'BIT'),
31+
['BITPOS', 'key', '1', '1', '-1', 'BIT']
32+
);
33+
});
34+
});
4235

43-
testUtils.testWithCluster('cluster.bitPos', async cluster => {
44-
assert.equal(
45-
await cluster.bitPos('key', 1, 1),
46-
-1
47-
);
48-
}, GLOBAL.CLUSTERS.OPEN);
36+
testUtils.testAll('bitPos', async client => {
37+
assert.equal(
38+
await client.bitPos('key', 1, 1),
39+
-1
40+
);
41+
}, {
42+
client: GLOBAL.SERVERS.OPEN,
43+
cluster: GLOBAL.CLUSTERS.OPEN
44+
});
4945
});

0 commit comments

Comments
 (0)