Hello!
On Sun, Mar 20, 2016 at 10:29 PM, Jon Keys wrote:
> === TEST 1: boom
> --- http_config
> init_by_lua_block {
> error('boom')
> }
> --- config
> --- must_die
> --- error_log
> boom
>
Your test file passes successfully on my side:
t/foo.t .. nginx: [error] init_by_lua error: init_by_lua:2: boom
stack traceback:
[C]: in function 'error'
init_by_lua:2: in main chunk
t/foo.t .. ok
All tests successful.
Files=1, Tests=2, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.10 cusr
0.03 csys = 0.14 CPU)
Result: PASS
> t/boom.t .. 1/?
> # Failed test 'TEST 1: boom - pattern "boom" should match a line in
> error.log (req 0)'
> # at /usr/local/share/perl5/Test/Nginx/Socket.pm line 1102.
Maybe your Test::Nginx installation is too old? Try upgrade it:
sudo cpan Test::Nginx
BTW, you can find quite some test cases using "--- must_die" in
OpenResty's test suite.
Regards,
-agentzh