From bd5f685d0ad0a48b14b92c7136620d3cb8016435 Mon Sep 17 00:00:00 2001 From: Leonid Shalupov Date: Sat, 13 Jun 2015 11:36:07 +0200 Subject: [PATCH] fix TestLsLong on non-UTC timezones --- fs/operations_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/operations_test.go b/fs/operations_test.go index a2c702481..44a7894c7 100644 --- a/fs/operations_test.go +++ b/fs/operations_test.go @@ -398,11 +398,12 @@ func TestLsLong(t *testing.T) { t.Fatalf("List failed: %v", err) } res := buf.String() - m1 := regexp.MustCompile(`(?m)^ 0 2011-12-25 12:59:59\.\d{9} empty space$`) + timeFormat := "2006-01-02 15:04:05" + m1 := regexp.MustCompile(`(?m)^ 0 ` + t2.Local().Format(timeFormat) + `\.\d{9} empty space$`) if !m1.MatchString(res) { t.Errorf("empty space missing: %q", res) } - m2 := regexp.MustCompile(`(?m)^ 60 2001-02-03 04:05:06\.\d{9} potato2$`) + m2 := regexp.MustCompile(`(?m)^ 60 ` + t1.Local().Format(timeFormat) + `\.\d{9} potato2$`) if !m2.MatchString(res) { t.Errorf("potato2 missing: %q", res) }