@@ -45,7 +45,7 @@ func TestAnalyze(t *testing.T) {
4545 // the state directive should only be in the "good" contexts
4646 if _ , ok := goodMap [key ]; ! ok {
4747 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 {
4949 t .Fatalf ("expected error to not be nil: %v" , err )
5050 } else if e , ok := err .(* ParseError ); ! ok {
5151 t .Fatalf ("error was not a ParseError: %v" , err )
@@ -106,7 +106,7 @@ func TestAnalyze_auth_jwt(t *testing.T) {
106106 tc := tc
107107 t .Run (name , func (t * testing.T ) {
108108 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 {})
110110
111111 if ! tc .wantErr && err != nil {
112112 t .Fatal (err )
@@ -159,7 +159,7 @@ func TestAnalyze_auth_jwt_require(t *testing.T) {
159159 tc := tc
160160 t .Run (name , func (t * testing.T ) {
161161 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 {})
163163
164164 if ! tc .wantErr && err != nil {
165165 t .Fatal (err )
@@ -531,7 +531,7 @@ func TestAnalyze_zone_sync(t *testing.T) {
531531 tc := tc
532532 t .Run (name , func (t * testing.T ) {
533533 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 {})
535535 if ! tc .wantErr && err != nil {
536536 t .Fatal (err )
537537 }
@@ -2338,7 +2338,7 @@ func TestAnalyze_mgmt(t *testing.T) {
23382338 tc := tc
23392339 t .Run (name , func (t * testing.T ) {
23402340 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 {})
23422342 if ! tc .wantErr && err != nil {
23432343 t .Fatal (err )
23442344 }
@@ -2593,7 +2593,6 @@ func TestAnalyze_directiveSources_defaultBehavior(t *testing.T) {
25932593 t .Run (name , func (t * testing.T ) {
25942594 t .Parallel ()
25952595 err := analyze ("nginx.conf" , tc .stmt , ";" , tc .ctx , & ParseOptions {
2596- DirectiveSources : []MatchFunc {MatchNginxPlusR33 },
25972596 ErrorOnUnknownDirectives : true ,
25982597 })
25992598
@@ -2618,7 +2617,7 @@ func TestAnalyze_limit_req_zone(t *testing.T) {
26182617 "limit_req_zone_4_args_nplus_latest" : {
26192618 args : []string {"$binary_remote_addr" , "zone=one:10m" , "rate=1r/s" , "sync" },
26202619 sources : []MatchFunc {MatchNginxPlusLatest },
2621- wantErr : true ,
2620+ wantErr : false ,
26222621 },
26232622 "limit_req_zone_3_args_nplus_latest" : {
26242623 args : []string {"$binary_remote_addr" , "zone=one:10m" , "rate=1r/s" },
@@ -2637,7 +2636,7 @@ func TestAnalyze_limit_req_zone(t *testing.T) {
26372636 },
26382637 "limit_req_zone_4_args_default_sources" : {
26392638 args : []string {"$binary_remote_addr" , "zone=one:10m" , "rate=1r/s" , "sync" },
2640- wantErr : true ,
2639+ wantErr : false ,
26412640 },
26422641 "limit_req_zone_3_args_default_sources" : {
26432642 args : []string {"$binary_remote_addr" , "zone=one:10m" , "rate=1r/s" },
0 commit comments