Skip to content

Commit 9bd6252

Browse files
committed
NLB-6350: fix analyze map-like unit test
1 parent 1fd5a56 commit 9bd6252

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

analyze_test.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2695,7 +2695,7 @@ func TestAnalyze_geoip2(t *testing.T) {
26952695
},
26962696
},
26972697
},
2698-
blockCtx{"http", "stream"},
2698+
blockCtx{"http"},
26992699
false,
27002700
},
27012701

@@ -2782,7 +2782,11 @@ func TestAnalyze_geoip2(t *testing.T) {
27822782
tc := tc
27832783
t.Run(name, func(t *testing.T) {
27842784
t.Parallel()
2785-
err := analyze("nginx.conf", tc.stmt, ";", tc.ctx, &ParseOptions{
2785+
terminator := ";"
2786+
if tc.stmt.Directive == "geoip2" {
2787+
terminator = "{"
2788+
}
2789+
err := analyze("nginx.conf", tc.stmt, terminator, tc.ctx, &ParseOptions{
27862790
DirectiveSources: []MatchFunc{MatchNginxPlusLatest, MatchGeoip2Latest},
27872791
})
27882792

@@ -2897,7 +2901,11 @@ func TestAnalyze_oidc(t *testing.T) {
28972901
tc := tc
28982902
t.Run(name, func(t *testing.T) {
28992903
t.Parallel()
2900-
err := analyze("nginx.conf", tc.stmt, ";", tc.ctx, &ParseOptions{
2904+
terminator := ";"
2905+
if tc.stmt.Directive == "oidc_provider" {
2906+
terminator = "{"
2907+
}
2908+
err := analyze("nginx.conf", tc.stmt, terminator, tc.ctx, &ParseOptions{
29012909
DirectiveSources: []MatchFunc{MatchNginxPlusR34},
29022910
})
29032911

0 commit comments

Comments
 (0)