Hello!
2014-03-23 4:52 GMT-07:00 aCayF:
> 1.如何使用test::nginx来测试nginx在解析配置文件阶段有可能报的错误?
这个功能目前尚不支持。欢迎贡献补丁 :)
> 2.下面这个问题可能是因为我没学过perl造成的,所以想请章老师帮我指正下可能存在的语法错误:)
[...]
> 错误提示是You asked for many requests, the expected results should be arrays as
> well.
> 实在是不知道为什么response这样写的方式就不是array了
>
我在我本地尝试了下面这个例子,是可以工作的:
=== TEST 1: basic test
--- config
location /test {
echo hello;
}
--- request eval
["GET /test", "GET /test"]
--- response_body_like eval
[qr/^hello$/, qr/^hello$/]
--- no_error_log
[error]
请确保你使用的是 git 仓库里的最新版本:
https://github.com/agentzh/test-nginx
Regards,
-agentzh