99func TestMatcherSyntax (t * testing.T ) {
1010 for i , tc := range []struct {
1111 input string
12- expectWarn bool
1312 expectError bool
1413 }{
1514 {
@@ -18,7 +17,6 @@ func TestMatcherSyntax(t *testing.T) {
1817 query showdebug=1
1918 }
2019 ` ,
21- expectWarn : false ,
2220 expectError : false ,
2321 },
2422 {
@@ -27,7 +25,6 @@ func TestMatcherSyntax(t *testing.T) {
2725 query bad format
2826 }
2927 ` ,
30- expectWarn : false ,
3128 expectError : true ,
3229 },
3330 {
@@ -38,7 +35,6 @@ func TestMatcherSyntax(t *testing.T) {
3835 }
3936 }
4037 ` ,
41- expectWarn : false ,
4238 expectError : false ,
4339 },
4440 {
@@ -47,14 +43,12 @@ func TestMatcherSyntax(t *testing.T) {
4743 not path /somepath*
4844 }
4945 ` ,
50- expectWarn : false ,
5146 expectError : false ,
5247 },
5348 {
5449 input : `http://localhost
5550 @debug not path /somepath*
5651 ` ,
57- expectWarn : false ,
5852 expectError : false ,
5953 },
6054 {
@@ -63,7 +57,6 @@ func TestMatcherSyntax(t *testing.T) {
6357 }
6458 http://localhost
6559 ` ,
66- expectWarn : false ,
6760 expectError : true ,
6861 },
6962 } {
@@ -72,12 +65,7 @@ func TestMatcherSyntax(t *testing.T) {
7265 ServerType : ServerType {},
7366 }
7467
75- _ , warnings , err := adapter .Adapt ([]byte (tc .input ), nil )
76-
77- if len (warnings ) > 0 != tc .expectWarn {
78- t .Errorf ("Test %d warning expectation failed Expected: %v, got %v" , i , tc .expectWarn , warnings )
79- continue
80- }
68+ _ , _ , err := adapter .Adapt ([]byte (tc .input ), nil )
8169
8270 if err != nil != tc .expectError {
8371 t .Errorf ("Test %d error expectation failed Expected: %v, got %s" , i , tc .expectError , err )
@@ -119,7 +107,6 @@ func TestSpecificity(t *testing.T) {
119107func TestGlobalOptions (t * testing.T ) {
120108 for i , tc := range []struct {
121109 input string
122- expectWarn bool
123110 expectError bool
124111 }{
125112 {
@@ -129,7 +116,6 @@ func TestGlobalOptions(t *testing.T) {
129116 }
130117 :80
131118 ` ,
132- expectWarn : false ,
133119 expectError : false ,
134120 },
135121 {
@@ -139,7 +125,6 @@ func TestGlobalOptions(t *testing.T) {
139125 }
140126 :80
141127 ` ,
142- expectWarn : false ,
143128 expectError : false ,
144129 },
145130 {
@@ -149,7 +134,6 @@ func TestGlobalOptions(t *testing.T) {
149134 }
150135 :80
151136 ` ,
152- expectWarn : false ,
153137 expectError : false ,
154138 },
155139 {
@@ -161,7 +145,6 @@ func TestGlobalOptions(t *testing.T) {
161145 }
162146 :80
163147 ` ,
164- expectWarn : false ,
165148 expectError : true ,
166149 },
167150 {
@@ -174,7 +157,6 @@ func TestGlobalOptions(t *testing.T) {
174157 }
175158 :80
176159 ` ,
177- expectWarn : false ,
178160 expectError : false ,
179161 },
180162 {
@@ -187,7 +169,6 @@ func TestGlobalOptions(t *testing.T) {
187169 }
188170 :80
189171 ` ,
190- expectWarn : false ,
191172 expectError : false ,
192173 },
193174 {
@@ -200,7 +181,6 @@ func TestGlobalOptions(t *testing.T) {
200181 }
201182 :80
202183 ` ,
203- expectWarn : false ,
204184 expectError : true ,
205185 },
206186 {
@@ -213,7 +193,6 @@ func TestGlobalOptions(t *testing.T) {
213193 }
214194 :80
215195 ` ,
216- expectWarn : false ,
217196 expectError : true ,
218197 },
219198 } {
@@ -222,12 +201,7 @@ func TestGlobalOptions(t *testing.T) {
222201 ServerType : ServerType {},
223202 }
224203
225- _ , warnings , err := adapter .Adapt ([]byte (tc .input ), nil )
226-
227- if len (warnings ) > 0 != tc .expectWarn {
228- t .Errorf ("Test %d warning expectation failed Expected: %v, got %v" , i , tc .expectWarn , warnings )
229- continue
230- }
204+ _ , _ , err := adapter .Adapt ([]byte (tc .input ), nil )
231205
232206 if err != nil != tc .expectError {
233207 t .Errorf ("Test %d error expectation failed Expected: %v, got %s" , i , tc .expectError , err )
0 commit comments