redict/tests
antirez 6dd1693c0e Scripting: redis.NIL to return nil bulk replies.
Lua arrays can't contain nil elements (see
http://www.lua.org/pil/19.1.html for more information), so Lua scripts
were not able to return a multi-bulk reply containing nil bulk
elements inside.

This commit introduces a special conversion: a table with just
a "nilbulk" field set to a boolean value is converted by Redis as a nil
bulk reply, but at the same time for Lua this type is not a "nil" so can
be used inside Lua arrays.

This type is also assigned to redis.NIL, so the following two forms
are equivalent and will be able to return a nil bulk reply as second
element of a three elements array:

    EVAL "return {1,redis.NIL,3}" 0
    EVAL "return {1,{nilbulk=true},3}" 0

The result in redis-cli will be:

    1) (integer) 1
    2) (nil)
    3) (integer) 3
2012-09-28 14:26:20 +02:00
..
assets fix typos in tests/assets/default.conf 2012-03-29 18:23:04 +08:00
helpers Regression test for issue 417 (memory leak when replicating to DB with id >= 10) 2012-03-30 10:26:07 +02:00
integration A reimplementation of blocking operation internals. 2012-09-17 10:26:46 +02:00
support New test: hash ziplist -> hashtable encoding conversion. 2012-06-11 15:19:46 +02:00
tmp minor fixes to the new test suite, html doc updated 2010-05-14 18:48:33 +02:00
unit Scripting: redis.NIL to return nil bulk replies. 2012-09-28 14:26:20 +02:00
test_helper.tcl BITOP and BITCOUNT tests. 2012-05-24 15:19:48 +02:00