LAST

运行到此测试块后停止执行后续测试块。

语法

--- LAST 段标记该测试块为最后一个要执行的块。配合 no_shuffle() 可以精确控制执行范围。

perl
1=== TEST 1: first
2--- config
3 location /t { echo "first"; }
4--- request
5GET /t
6--- response_body
7first
8
9
10
11=== TEST 2: last one
12--- LAST
13--- config
14 location /t { echo "stop here"; }
15--- request
16GET /t
17--- response_body
18stop here
19
20
21
22=== TEST 3: will not run
23--- config
24 location /t { echo "never"; }
25--- request
26GET /t
27--- response_body
28never

搭配 prologue 中的 no_shuffle() 使用效果最佳,否则随机顺序下 LAST 的行为不可预测。