Lines Matching +full:test +full:-

1 -- This test checks the Lua functions:
2 -- get_var, get_cookie, md5, url_encode
5 cookie_name = "CivetWeb-test-page4"
13 mg.write("Content-Type: text/html; charset=utf-8\r\n")
14 mg.write("Cache-Control: max-age=0, must-revalidate\r\n")
16 mg.write("Set-Cookie: " .. cookie_name .. "=" .. tostring(now) .. "\r\n")
20 mg.write("<html>\r\n<head><title>CivetWeb Lua script test page 4</title></head>\r\n<body>\r\n")
21 mg.write("<p>Test of CivetWeb Lua Functions:</p>\r\n");
24 -- get_var of query_string
25 mg.write("get_var test (check query string):\r\n")
40 -- md5
41 mg.write("MD5 test:\r\n")
52 mg.write(" MD5 of test string OK\r\n")
54 mg.write(" Error: MD5 of test string NOT OK\r\n")
58 -- get_cookie
59 mg.write("Cookie test:\r\n")
68 -- test 'require' of other Lua scripts
69 mg.write("require test\r\n")
85 mg.write(" 'require' test failed (htmlEscape)\r\n")
94 mg.write(" 'require' test failed (HugeText)\r\n")
101 -- test get_response_code_text
102 mg.write("HTTP helper methods test:\r\n")
104 mg.write(" htmlEscape test OK\r\n")
106 mg.write(" Error: htmlEscape test NOT OK\r\n")
109 mg.write(" get_response_code_text test OK\r\n")
111 mg.write(" Error: get_response_code_text test NOT OK\r\n")
115 -- url_encode
116 mg.write("URL encode/decode test:\r\n")
122 raw_string = [[ !"#$%&'()*+,-./0123456789:;<=>?@]]
125 ref_string = "%20!%22%23%24%25%26'()*%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40" -- from http://www…
126 mg.write(" mg-url: " .. htmlEscape(mg_string) .. "\r\n")
130 mg.write(" decoded mg-url: " .. htmlEscape(dec_mg_string) .. "\r\n")
134 mg.write(" decoded mg-url: " .. htmlEscape(dec_mg_string) .. "\r\n")
138 mg.write(" decoded mg-url: " .. htmlEscape(dec_mg_string) .. "\r\n")
142 -- base64_encode
143 mg.write("BASE64 encode/decode test:\r\n")
144 raw_string = [[ !"#$%&'()*+,-./0123456789:;<=>?@]]
147 ref_string = "ICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9A" -- from http://www.base64encode.org/
148 mg.write(" mg-base64: " .. htmlEscape(mg_string) .. "\r\n")
152 mg.write(" decoded mg-base64: " .. htmlEscape(dec_mg_string) .. "\r\n")
155 raw_string = [[<?> -?-]]
158 ref_string = "PD8+IC0/LQ==" -- from http://www.base64encode.org/
159 mg.write(" mg-base64: " .. htmlEscape(mg_string) .. "\r\n")
163 mg.write(" decoded mg-base64: " .. htmlEscape(dec_mg_string) .. "\r\n")
167 -- random
172 -- uuid
179 -- end of page