1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Add test for GET non-existent-key case. (issue #267)

This commit is contained in:
Chakrit Wichian
2012-09-12 01:26:23 +07:00
parent 668dfdead6
commit 587d4a361b

11
test.js
View File

@@ -817,12 +817,19 @@ tests.DBSIZE = function () {
client.DBSIZE([], last(name, require_number_pos("DBSIZE")));
};
tests.GET = function () {
var name = "GET";
tests.GET_1 = function () {
var name = "GET_1";
client.set(["get key", "get val"], require_string("OK", name));
client.GET(["get key"], last(name, require_string("get val", name)));
};
tests.GET_2 = function() {
var name = "GET_2";
// tests handling of non-existent keys
client.GET('this_key_shouldnt_exist', last(name, require_null(name)));
};
tests.SET = function () {
var name = "SET";
client.SET(["set key", "set val"], require_string("OK", name));