Fix test to adjust for missing quotes

This commit is contained in:
Giovanni Bajo 2014-12-18 15:14:24 +01:00
parent 15b296befc
commit e5c1364122
1 changed files with 6 additions and 2 deletions

View File

@ -44,8 +44,12 @@ func LogAndAssertText(t *testing.T, log func(*Logger), assertions func(fields ma
}
kvArr := strings.Split(kv, "=")
key := strings.TrimSpace(kvArr[0])
val, err := strconv.Unquote(kvArr[1])
assert.NoError(t, err)
val := kvArr[1]
if kvArr[1][0] == '"' {
var err error
val, err = strconv.Unquote(val)
assert.NoError(t, err)
}
fields[key] = val
}
assertions(fields)