LAST
运行到此测试块后停止执行后续测试块。
语法
--- LAST 段标记该测试块为最后一个要执行的块。配合 no_shuffle() 可以精确控制执行范围。
perl
1=== TEST 1: first2--- config3 location /t { echo "first"; }4--- request5GET /t6--- response_body7first891011=== TEST 2: last one12--- LAST13--- config14 location /t { echo "stop here"; }15--- request16GET /t17--- response_body18stop here19202122=== TEST 3: will not run23--- config24 location /t { echo "never"; }25--- request26GET /t27--- response_body28never搭配 prologue 中的 no_shuffle() 使用效果最佳,否则随机顺序下 LAST 的行为不可预测。