From 587d4a361be97f3014c84f6ae1ad4a906ca5d4fb Mon Sep 17 00:00:00 2001 From: Chakrit Wichian Date: Wed, 12 Sep 2012 01:26:23 +0700 Subject: [PATCH] Add test for `GET non-existent-key` case. (issue #267) --- test.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test.js b/test.js index 0a03375e55c..9b3c4526488 100644 --- a/test.js +++ b/test.js @@ -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));