@@ -51,7 +51,7 @@ func TestAnalyzeMapBody(t *testing.T) {
5151 Block : Directives {},
5252 },
5353 term : ";" ,
54- wantErr : & ParseError {What : "invalid number of parameters" },
54+ wantErr : & ParseError {What : "invalid number of parameters" , BlockCtx : "map" },
5555 },
5656 "valid map hostnames parameter" : {
5757 mapDirective : "map" ,
@@ -71,7 +71,7 @@ func TestAnalyzeMapBody(t *testing.T) {
7171 Block : Directives {},
7272 },
7373 term : ";" ,
74- wantErr : & ParseError {What : "invalid number of parameters" },
74+ wantErr : & ParseError {What : "invalid number of parameters" , BlockCtx : "map" },
7575 },
7676 "valid geo proxy_recursive parameter" : {
7777 mapDirective : "geo" ,
@@ -100,7 +100,7 @@ func TestAnalyzeMapBody(t *testing.T) {
100100 Block : Directives {},
101101 },
102102 term : ";" ,
103- wantErr : & ParseError {What : "invalid number of parameters" },
103+ wantErr : & ParseError {What : "invalid number of parameters" , BlockCtx : "types" },
104104 },
105105 "invalid geo proxy_recursive parameter" : {
106106 mapDirective : "geo" ,
@@ -111,7 +111,7 @@ func TestAnalyzeMapBody(t *testing.T) {
111111 Block : Directives {},
112112 },
113113 term : ";" ,
114- wantErr : & ParseError {What : "invalid number of parameters" },
114+ wantErr : & ParseError {What : "invalid number of parameters" , BlockCtx : "geo" },
115115 },
116116 "valid geo ranges parameter" : {
117117 mapDirective : "geo" ,
@@ -131,7 +131,7 @@ func TestAnalyzeMapBody(t *testing.T) {
131131 Block : Directives {},
132132 },
133133 term : ";" ,
134- wantErr : & ParseError {What : "invalid number of parameters" },
134+ wantErr : & ParseError {What : "invalid number of parameters" , BlockCtx : "geo" },
135135 },
136136 "invalid number of parameters in map" : {
137137 mapDirective : "map" ,
@@ -142,7 +142,7 @@ func TestAnalyzeMapBody(t *testing.T) {
142142 Block : Directives {},
143143 },
144144 term : ";" ,
145- wantErr : & ParseError {What : "invalid number of parameters" },
145+ wantErr : & ParseError {What : "invalid number of parameters" , BlockCtx : "map" },
146146 },
147147 "valid split_clients" : {
148148 mapDirective : "split_clients" ,
@@ -163,7 +163,7 @@ func TestAnalyzeMapBody(t *testing.T) {
163163 Block : Directives {},
164164 },
165165 term : ";" ,
166- wantErr : & ParseError {What : "invalid number of parameters" },
166+ wantErr : & ParseError {What : "invalid number of parameters" , BlockCtx : "split_clients" },
167167 },
168168 "missing semicolon" : {
169169 mapDirective : "map" ,
@@ -174,7 +174,7 @@ func TestAnalyzeMapBody(t *testing.T) {
174174 Block : Directives {},
175175 },
176176 term : "}" ,
177- wantErr : & ParseError {What : `unexpected "}"` },
177+ wantErr : & ParseError {What : `unexpected "}"` , BlockCtx : "map" },
178178 },
179179 }
180180
@@ -194,6 +194,7 @@ func TestAnalyzeMapBody(t *testing.T) {
194194 var perr * ParseError
195195 require .ErrorAs (t , err , & perr )
196196 require .Equal (t , tc .wantErr .What , perr .What )
197+ require .Equal (t , tc .wantErr .BlockCtx , perr .BlockCtx )
197198 })
198199 }
199200}
0 commit comments