added more (passing) tests for the shared dict API.
This commit is contained in:
Родитель
f5a4f7243e
Коммит
2549ab48eb
|
@ -188,7 +188,7 @@ GET /test
|
|||
while i < 1000 do
|
||||
i = i + 1
|
||||
local val = string.rep(" hello " .. i, 10)
|
||||
local override = dogs:set("key_" .. i, val, 0.02)
|
||||
local override = dogs:set("key_" .. i, val)
|
||||
if override then
|
||||
break
|
||||
end
|
||||
|
@ -232,3 +232,22 @@ hello, world
|
|||
56
|
||||
hello, world
|
||||
|
||||
|
||||
|
||||
=== TEST 10: get non-existent keys
|
||||
--- http_config
|
||||
lua_shared_dict dogs 1m;
|
||||
--- config
|
||||
location = /test {
|
||||
content_by_lua '
|
||||
local dogs = ngx.shared.dogs
|
||||
ngx.say(dogs:get("foo"))
|
||||
ngx.say(dogs:get("foo"))
|
||||
';
|
||||
}
|
||||
--- request
|
||||
GET /test
|
||||
--- response_body
|
||||
nil
|
||||
nil
|
||||
|
||||
|
|
|
@ -35,6 +35,6 @@ ngx-build $force $version \
|
|||
--add-module=$root/../drizzle-nginx-module \
|
||||
--add-module=$home/work/nginx/ngx_http_upstream_keepalive-2ce9d8a1ca93 \
|
||||
--add-module=$root/../rds-json-nginx-module \
|
||||
$opts #\
|
||||
#--with-debug
|
||||
$opts \
|
||||
--with-debug
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче