Clean up tests a little

This commit is contained in:
Justin Li
2013-12-13 11:48:47 -05:00
parent 140a738162
commit e8e692cbf6
3 changed files with 46 additions and 57 deletions

View File

@@ -35,10 +35,7 @@ func mapArrayEqual(boxed map[string][]string, unboxed map[string]string) bool {
}
for mapKey, mapVal := range boxed {
// Always expect box to hold only one element
if len(mapVal) != 1 {
return false
}
if ub_mapVal, eleExists := unboxed[mapKey]; !eleExists || mapVal[0] != ub_mapVal {
if len(mapVal) != 1 || mapVal[0] != unboxed[mapKey] {
return false
}
}
@@ -61,10 +58,10 @@ func TestInvalidQueries(t *testing.T) {
for parseIndex, parseStr := range InvalidQueries {
parsedQueryObj, err := parseQuery(parseStr)
if err == nil {
t.Error("Should have produced error ", parseIndex)
t.Error("Should have produced error", parseIndex)
}
if parsedQueryObj != nil {
t.Error("Should be nil after error ", parsedQueryObj, parseIndex)
t.Error("Should be nil after error", parsedQueryObj, parseIndex)
}
}
}