~ubuntu-branches/ubuntu/wily/nginx/wily-proposed

« back to all changes in this revision

Viewing changes to debian/modules/nginx-lua/t/043-shdict.t

  • Committer: Package Import Robot
  • Author(s): Dmitry Shachnev
  • Date: 2013-05-11 14:47:53 UTC
  • mfrom: (4.3.1 sid)
  • Revision ID: package-import@ubuntu.com-20130511144753-a65vqwrxy58omej4
Tags: 1.4.1-1ubuntu1
* Merge with Debian unstable (LP: #1177919). Remaining changes:
  - debian/conf/sites-available/default:
    + Modify default site configuration file to correct a typo
      that prevented out-of-the-box usability (LP: #1162177).
  - debian/patches/ubuntu-branding.patch:
    + Add ubuntu branding to server_tokens.
* Refresh all patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
#repeat_each(2);
10
10
 
11
 
plan tests => repeat_each() * (blocks() * 2 + 7);
 
11
plan tests => repeat_each() * (blocks() * 2 + 15);
12
12
 
13
13
#no_diff();
14
14
no_long_string();
1373
1373
--- response_body
1374
1374
2048
1375
1375
 
 
1376
 
 
1377
 
 
1378
=== TEST 58: safe_set
 
1379
--- http_config
 
1380
    lua_shared_dict dogs 100k;
 
1381
--- config
 
1382
    location = /test {
 
1383
        content_by_lua '
 
1384
            local dogs = ngx.shared.dogs
 
1385
            local i = 0
 
1386
            while i < 1000 do
 
1387
                i = i + 1
 
1388
                local val = string.rep(" hello", 10) .. i
 
1389
                local res, err = dogs:safe_set("key_" .. i, val)
 
1390
                if not res then
 
1391
                    ngx.say(res, " ", err)
 
1392
                    break
 
1393
                end
 
1394
            end
 
1395
            ngx.say("abort at ", i)
 
1396
            ngx.say("cur value: ", dogs:get("key_" .. i))
 
1397
            if i > 1 then
 
1398
                ngx.say("1st value: ", dogs:get("key_1"))
 
1399
            end
 
1400
            if i > 2 then
 
1401
                ngx.say("2nd value: ", dogs:get("key_2"))
 
1402
            end
 
1403
        ';
 
1404
    }
 
1405
--- pipelined_requests eval
 
1406
["GET /test", "GET /test"]
 
1407
--- response_body eval
 
1408
my $a = "nil no memory\nabort at (353|705)\ncur value: nil\n1st value: " . (" hello" x 10) . "1\n2nd value: " . (" hello" x 10) . "2\n";
 
1409
[qr/$a/, qr/$a/]
 
1410
--- no_error_log
 
1411
[error]
 
1412
 
 
1413
 
 
1414
 
 
1415
=== TEST 59: safe_add
 
1416
--- http_config
 
1417
    lua_shared_dict dogs 100k;
 
1418
--- config
 
1419
    location = /test {
 
1420
        content_by_lua '
 
1421
            local dogs = ngx.shared.dogs
 
1422
            local i = 0
 
1423
            while i < 1000 do
 
1424
                i = i + 1
 
1425
                local val = string.rep(" hello", 10) .. i
 
1426
                local res, err = dogs:safe_add("key_" .. i, val)
 
1427
                if not res then
 
1428
                    ngx.say(res, " ", err)
 
1429
                    break
 
1430
                end
 
1431
            end
 
1432
            ngx.say("abort at ", i)
 
1433
            ngx.say("cur value: ", dogs:get("key_" .. i))
 
1434
            if i > 1 then
 
1435
                ngx.say("1st value: ", dogs:get("key_1"))
 
1436
            end
 
1437
            if i > 2 then
 
1438
                ngx.say("2nd value: ", dogs:get("key_2"))
 
1439
            end
 
1440
        ';
 
1441
    }
 
1442
--- pipelined_requests eval
 
1443
["GET /test", "GET /test"]
 
1444
--- response_body eval
 
1445
my $a = "nil no memory\nabort at (353|705)\ncur value: nil\n1st value: " . (" hello" x 10) . "1\n2nd value: " . (" hello" x 10) . "2\n";
 
1446
[qr/$a/,
 
1447
q{false exists
 
1448
abort at 1
 
1449
cur value:  hello hello hello hello hello hello hello hello hello hello1
 
1450
}
 
1451
]
 
1452
--- no_error_log
 
1453
[error]
 
1454