diff options
| author | Gerardo Marset <gammer1994@gmail.com> | 2013-02-25 20:28:28 -0200 |
|---|---|---|
| committer | Gerardo Marset <gammer1994@gmail.com> | 2013-02-25 20:28:28 -0200 |
| commit | 56893e9dcd1eeebffb42b227a2151e18d49bc370 (patch) | |
| tree | db1e6c023b75b19bb8d761c3d8df576cd6b4d5cd /test/httptest.lua | |
| parent | d548a78e5516bcc85d44f1d419cf53c71d6dcd79 (diff) | |
| download | luasocket-56893e9dcd1eeebffb42b227a2151e18d49bc370.tar.gz luasocket-56893e9dcd1eeebffb42b227a2151e18d49bc370.tar.bz2 luasocket-56893e9dcd1eeebffb42b227a2151e18d49bc370.zip | |
Use the length operator (#) instead of table.getn.
table.getn was deprecated in Lua 5.1 in favor of #, the length operator.
See: http://www.lua.org/manual/5.1/manual.html#7.2
Diffstat (limited to 'test/httptest.lua')
| -rw-r--r-- | test/httptest.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/httptest.lua b/test/httptest.lua index 614acf3..d5fbb37 100644 --- a/test/httptest.lua +++ b/test/httptest.lua | |||
| @@ -66,7 +66,7 @@ local check_request = function(request, expect, ignore) | |||
| 66 | local response = {} | 66 | local response = {} |
| 67 | response.code, response.headers, response.status = | 67 | response.code, response.headers, response.status = |
| 68 | socket.skip(1, http.request(request)) | 68 | socket.skip(1, http.request(request)) |
| 69 | if t and table.getn(t) > 0 then response.body = table.concat(t) end | 69 | if t and #t > 0 then response.body = table.concat(t) end |
| 70 | check_result(response, expect, ignore) | 70 | check_result(response, expect, ignore) |
| 71 | end | 71 | end |
| 72 | 72 | ||
