@@ -45,7 +45,7 @@ func TestAnalyze(t *testing.T) {
45
45
// the state directive should only be in the "good" contexts
46
46
if _ , ok := goodMap [key ]; ! ok {
47
47
actx := blockCtx (strings .Split (key , ">" ))
48
- if err := analyze (fname , stmt , ";" , actx , & ParseOptions {DirectiveSources : [] MatchFunc { MatchNginxPlusR33 } }); err == nil {
48
+ if err := analyze (fname , stmt , ";" , actx , & ParseOptions {}); err == nil {
49
49
t .Fatalf ("expected error to not be nil: %v" , err )
50
50
} else if e , ok := err .(* ParseError ); ! ok {
51
51
t .Fatalf ("error was not a ParseError: %v" , err )
@@ -106,7 +106,7 @@ func TestAnalyze_auth_jwt(t *testing.T) {
106
106
tc := tc
107
107
t .Run (name , func (t * testing.T ) {
108
108
t .Parallel ()
109
- err := analyze ("nginx.conf" , tc .stmt , ";" , tc .ctx , & ParseOptions {DirectiveSources : [] MatchFunc { MatchNginxPlusR33 } })
109
+ err := analyze ("nginx.conf" , tc .stmt , ";" , tc .ctx , & ParseOptions {})
110
110
111
111
if ! tc .wantErr && err != nil {
112
112
t .Fatal (err )
@@ -159,7 +159,7 @@ func TestAnalyze_auth_jwt_require(t *testing.T) {
159
159
tc := tc
160
160
t .Run (name , func (t * testing.T ) {
161
161
t .Parallel ()
162
- err := analyze ("nginx.conf" , tc .stmt , ";" , tc .ctx , & ParseOptions {DirectiveSources : [] MatchFunc { MatchNginxPlusR33 } })
162
+ err := analyze ("nginx.conf" , tc .stmt , ";" , tc .ctx , & ParseOptions {})
163
163
164
164
if ! tc .wantErr && err != nil {
165
165
t .Fatal (err )
@@ -531,7 +531,7 @@ func TestAnalyze_zone_sync(t *testing.T) {
531
531
tc := tc
532
532
t .Run (name , func (t * testing.T ) {
533
533
t .Parallel ()
534
- err := analyze ("nginx.conf" , tc .stmt , ";" , tc .ctx , & ParseOptions {DirectiveSources : [] MatchFunc { MatchNginxPlusR33 } })
534
+ err := analyze ("nginx.conf" , tc .stmt , ";" , tc .ctx , & ParseOptions {})
535
535
if ! tc .wantErr && err != nil {
536
536
t .Fatal (err )
537
537
}
@@ -2338,7 +2338,7 @@ func TestAnalyze_mgmt(t *testing.T) {
2338
2338
tc := tc
2339
2339
t .Run (name , func (t * testing.T ) {
2340
2340
t .Parallel ()
2341
- err := analyze ("nginx.conf" , tc .stmt , ";" , tc .ctx , & ParseOptions {DirectiveSources : [] MatchFunc { MatchNginxPlusR33 } })
2341
+ err := analyze ("nginx.conf" , tc .stmt , ";" , tc .ctx , & ParseOptions {})
2342
2342
if ! tc .wantErr && err != nil {
2343
2343
t .Fatal (err )
2344
2344
}
@@ -2593,7 +2593,6 @@ func TestAnalyze_directiveSources_defaultBehavior(t *testing.T) {
2593
2593
t .Run (name , func (t * testing.T ) {
2594
2594
t .Parallel ()
2595
2595
err := analyze ("nginx.conf" , tc .stmt , ";" , tc .ctx , & ParseOptions {
2596
- DirectiveSources : []MatchFunc {MatchNginxPlusR33 },
2597
2596
ErrorOnUnknownDirectives : true ,
2598
2597
})
2599
2598
@@ -2618,7 +2617,7 @@ func TestAnalyze_limit_req_zone(t *testing.T) {
2618
2617
"limit_req_zone_4_args_nplus_latest" : {
2619
2618
args : []string {"$binary_remote_addr" , "zone=one:10m" , "rate=1r/s" , "sync" },
2620
2619
sources : []MatchFunc {MatchNginxPlusLatest },
2621
- wantErr : true ,
2620
+ wantErr : false ,
2622
2621
},
2623
2622
"limit_req_zone_3_args_nplus_latest" : {
2624
2623
args : []string {"$binary_remote_addr" , "zone=one:10m" , "rate=1r/s" },
@@ -2637,7 +2636,7 @@ func TestAnalyze_limit_req_zone(t *testing.T) {
2637
2636
},
2638
2637
"limit_req_zone_4_args_default_sources" : {
2639
2638
args : []string {"$binary_remote_addr" , "zone=one:10m" , "rate=1r/s" , "sync" },
2640
- wantErr : true ,
2639
+ wantErr : false ,
2641
2640
},
2642
2641
"limit_req_zone_3_args_default_sources" : {
2643
2642
args : []string {"$binary_remote_addr" , "zone=one:10m" , "rate=1r/s" },
0 commit comments