Skip to content

Commit

Permalink
added more (passing) tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
agentzh committed Dec 19, 2013
1 parent c840479 commit 3475f55
Showing 1 changed file with 25 additions and 20 deletions.
45 changes: 25 additions & 20 deletions t/sanity.t
Expand Up @@ -136,18 +136,20 @@ flushall: OK
ngx.say("flushall: ", res)
res, err = red:get("not_found")
if err then
ngx.say("failed to get: ", err)
return
end
for i = 1, 2 do
res, err = red:get("not_found")
if err then
ngx.say("failed to get: ", err)
return
end
if res == ngx.null then
ngx.say("not_found not found.")
return
end
if res == ngx.null then
ngx.say("not_found not found.")
return
end
ngx.say("get not_found: ", res)
ngx.say("get not_found: ", res)
end
red:close()
';
Expand Down Expand Up @@ -186,18 +188,20 @@ not_found not found.
ngx.say("flushall: ", res)
res, err = red:lrange("nokey", 0, 1)
if err then
ngx.say("failed to get: ", err)
return
end
for i = 1, 2 do
res, err = red:lrange("nokey", 0, 1)
if err then
ngx.say("failed to get: ", err)
return
end
if res == ngx.null then
ngx.say("nokey not found.")
return
end
if res == ngx.null then
ngx.say("nokey not found.")
return
end
ngx.say("get nokey: ", #res, " (", type(res), ")")
ngx.say("get nokey: ", #res, " (", type(res), ")")
end
red:close()
';
Expand All @@ -207,6 +211,7 @@ GET /t
--- response_body
flushall: OK
get nokey: 0 (table)
get nokey: 0 (table)
--- no_error_log
[error]
Expand Down

0 comments on commit 3475f55

Please sign in to comment.