@ -9,7 +9,6 @@ import (
func TestMatcherSyntax ( t * testing . T ) {
for i , tc := range [ ] struct {
input string
expectWarn bool
expectError bool
} {
{
@ -18,7 +17,6 @@ func TestMatcherSyntax(t *testing.T) {
query showdebug = 1
}
` ,
expectWarn : false ,
expectError : false ,
} ,
{
@ -27,7 +25,6 @@ func TestMatcherSyntax(t *testing.T) {
query bad format
}
` ,
expectWarn : false ,
expectError : true ,
} ,
{
@ -38,7 +35,6 @@ func TestMatcherSyntax(t *testing.T) {
}
}
` ,
expectWarn : false ,
expectError : false ,
} ,
{
@ -47,14 +43,12 @@ func TestMatcherSyntax(t *testing.T) {
not path / somepath *
}
` ,
expectWarn : false ,
expectError : false ,
} ,
{
input : ` http : //localhost
@ debug not path / somepath *
` ,
expectWarn : false ,
expectError : false ,
} ,
{
@ -63,7 +57,6 @@ func TestMatcherSyntax(t *testing.T) {
}
http : //localhost
` ,
expectWarn : false ,
expectError : true ,
} ,
} {
@ -72,12 +65,7 @@ func TestMatcherSyntax(t *testing.T) {
ServerType : ServerType { } ,
}
_ , warnings , err := adapter . Adapt ( [ ] byte ( tc . input ) , nil )
if len ( warnings ) > 0 != tc . expectWarn {
t . Errorf ( "Test %d warning expectation failed Expected: %v, got %v" , i , tc . expectWarn , warnings )
continue
}
_ , _ , err := adapter . Adapt ( [ ] byte ( tc . input ) , nil )
if err != nil != tc . expectError {
t . Errorf ( "Test %d error expectation failed Expected: %v, got %s" , i , tc . expectError , err )
@ -119,7 +107,6 @@ func TestSpecificity(t *testing.T) {
func TestGlobalOptions ( t * testing . T ) {
for i , tc := range [ ] struct {
input string
expectWarn bool
expectError bool
} {
{
@ -129,7 +116,6 @@ func TestGlobalOptions(t *testing.T) {
}
: 80
` ,
expectWarn : false ,
expectError : false ,
} ,
{
@ -139,7 +125,6 @@ func TestGlobalOptions(t *testing.T) {
}
: 80
` ,
expectWarn : false ,
expectError : false ,
} ,
{
@ -149,7 +134,6 @@ func TestGlobalOptions(t *testing.T) {
}
: 80
` ,
expectWarn : false ,
expectError : false ,
} ,
{
@ -161,7 +145,6 @@ func TestGlobalOptions(t *testing.T) {
}
: 80
` ,
expectWarn : false ,
expectError : true ,
} ,
{
@ -174,7 +157,6 @@ func TestGlobalOptions(t *testing.T) {
}
: 80
` ,
expectWarn : false ,
expectError : false ,
} ,
{
@ -187,7 +169,6 @@ func TestGlobalOptions(t *testing.T) {
}
: 80
` ,
expectWarn : false ,
expectError : false ,
} ,
{
@ -200,7 +181,6 @@ func TestGlobalOptions(t *testing.T) {
}
: 80
` ,
expectWarn : false ,
expectError : true ,
} ,
{
@ -213,7 +193,6 @@ func TestGlobalOptions(t *testing.T) {
}
: 80
` ,
expectWarn : false ,
expectError : true ,
} ,
} {
@ -222,12 +201,7 @@ func TestGlobalOptions(t *testing.T) {
ServerType : ServerType { } ,
}
_ , warnings , err := adapter . Adapt ( [ ] byte ( tc . input ) , nil )
if len ( warnings ) > 0 != tc . expectWarn {
t . Errorf ( "Test %d warning expectation failed Expected: %v, got %v" , i , tc . expectWarn , warnings )
continue
}
_ , _ , err := adapter . Adapt ( [ ] byte ( tc . input ) , nil )
if err != nil != tc . expectError {
t . Errorf ( "Test %d error expectation failed Expected: %v, got %s" , i , tc . expectError , err )