From e5c1364122680f75bf4615a880a4afae08ccef53 Mon Sep 17 00:00:00 2001 From: Giovanni Bajo Date: Thu, 18 Dec 2014 15:14:24 +0100 Subject: [PATCH] Fix test to adjust for missing quotes --- logrus_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/logrus_test.go b/logrus_test.go index 15157d1..0682281 100644 --- a/logrus_test.go +++ b/logrus_test.go @@ -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)