skip_nginx

根据 Nginx 版本号决定是否跳过测试块。

语法

--- skip_nginx 段的格式为 N: condition,其中 N 是要跳过的测试数量。condition 基于 $Test::Nginx::Util::NginxVersion 变量。适用于某些特性只在特定 Nginx 版本中存在的场景。

perl
1=== TEST 1: feature only in nginx 1.21+
2--- skip_nginx
32: < 1.21.0
4--- config
5 location /t {
6 echo "new feature";
7 }
8--- request
9GET /t
10--- response_body
11new feature

skip_nginx 中的版本比较支持 <、>、<=、>= 运算符。多个条件可以用换行分隔。