安装使用cpan已经搞定,强大的命令
写了个脚本试了下,只有一个用例,但测试输出说运行了2个用例,难道还有一个隐藏用例?是不是我的plan写得不对,请春哥指点下,多谢
测试输出:
[wangxi1@109 ~]$ TEST_NGINX_PORT=31127 TEST_NGINX_CLIENT_PORT=31127 prove -r t/
t/parser....ok 1/1# Looks like you planned 1 test but ran 2.
t/parser....dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED test 2
Failed 1/1 tests, 0.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/parser.t 255 65280 1 1 100.00% 2
Failed 1/1 test scripts, 0.00% okay. -1/1 subtests failed, 200.00% okay.
测试脚本:
use lib 'lib';
2 use Test::Nginx::Socket;
3
4 repeat_each(1);
5 plan tests => 1;
6
7 run_tests();
8
9 __DATA__
10
11 === TEST 1: parser
12 --- http_config
13 lua_package_path '/usr/home/wangxi1/asp/trunk/src/lua/?.lua;;';
14 --- config
15 location /main {
16 proxy_pass_request_headers off;
17 content_by_lua_file /usr/home/wangxi1/asp/trunk/src/lua/main.lua;
18 }
19 --- request
20 GET /main?ADUNIT=123
21 --- response_body
22 123