1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
Files
node-redis/test/parser/javascript.spec.js
Benjamin Coe a0832c3744 slight refactor from code review
smoke test large list of commands

ported more tests to mocha, some slight cleanup in tests

move sinon and uuid to dev dependencies

finished porting eval tests over to mocha

rebased mocha testing branch with master

ported client and script tests

ported watch tests

ported detect_buffers tests

ported unref tests

ported auth tests over to mocha

ported idle and no_delay tests

ported hlen, hset

continuing marching forward

ported hincrby, sinter, sort, pubsub tests. improved logic in redis-process, I was still occasionally having issues where redis failed to exit.

switch back to default test command

ported del, exists, hlen, keys, randomkey, type

cleanup based on what I've learned so far from refactor. we now start and stop redis less often. moved tests to their final resting place

finished porting node_redis client tests

ported hgetall, mget, msetnx, rename, renamenx, setex, setnx

ported hgetall, mget, msetnx, rename, renamenx, setex, setnx

ported queue tests to mocha

amalgamated some of the helper logic

ported sadd, scard, sismember, srem, utf-8
2015-08-14 21:31:18 -07:00

28 lines
886 B
JavaScript

/* global describe, it */
var assert = require('assert');
var Parser = require("../../lib/parser/javascript").Parser;
describe('javascript parser', function () {
it('handles multi-bulk reply', function (done) {
var parser = new Parser(false);
var reply_count = 0;
function check_reply(reply) {
assert.deepEqual(reply, [['a']], "Expecting multi-bulk reply of [['a']]");
reply_count++;
}
parser.on("reply", check_reply);
parser.execute(new Buffer('*1\r\n*1\r\n$1\r\na\r\n'));
parser.execute(new Buffer('*1\r\n*1\r'));
parser.execute(new Buffer('\n$1\r\na\r\n'));
parser.execute(new Buffer('*1\r\n*1\r\n'));
parser.execute(new Buffer('$1\r\na\r\n'));
assert.equal(reply_count, 3, "check reply should have been called three times");
return done();
});
});