From a3c08931eb807a8195658da47cff8b7a9895c4b4 Mon Sep 17 00:00:00 2001 From: Sho Mizutani Date: Thu, 14 Jan 2021 15:34:36 +0900 Subject: [PATCH] Update test --- src/date_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/date_test.go b/src/date_test.go index a99cee6..190bd1e 100644 --- a/src/date_test.go +++ b/src/date_test.go @@ -14,23 +14,23 @@ type testCase struct { func TestNewDate(t *testing.T) { testCases := []testCase{ // Monday when Jan 1st is Monday - {now: "2018-01-01T00:00:00Z", should: "2018 Week 01, Week of 2018/01/01."}, + {now: "2018-01-01T00:00:00Z", should: "2018 Week 01, Week of 2018/01/01. Year 2018, Month 01, Day 01"}, // Monday when Jan 1st is Tuesday - {now: "2018-12-31T00:00:00Z", should: "2019 Week 01, Week of 2018/12/31."}, + {now: "2018-12-31T00:00:00Z", should: "2019 Week 01, Week of 2018/12/31. Year 2018, Month 12, Day 31"}, // Monday when Jan 1st is Wednesday - {now: "2019-12-30T00:00:00Z", should: "2020 Week 01, Week of 2019/12/30."}, + {now: "2019-12-30T00:00:00Z", should: "2020 Week 01, Week of 2019/12/30. Year 2019, Month 12, Day 30"}, // Monday when Jan 1st is Thursday - {now: "2025-12-29T00:00:00Z", should: "2026 Week 01, Week of 2025/12/29."}, + {now: "2025-12-29T00:00:00Z", should: "2026 Week 01, Week of 2025/12/29. Year 2025, Month 12, Day 29"}, // Monday when Jan 1st is Friday - {now: "2020-12-28T00:00:00Z", should: "2020 Week 53, Week of 2020/12/28."}, + {now: "2020-12-28T00:00:00Z", should: "2020 Week 53, Week of 2020/12/28. Year 2020, Month 12, Day 28"}, // Monday when Jan 1st is Saturday - {now: "2021-12-27T00:00:00Z", should: "2021 Week 52, Week of 2021/12/27."}, + {now: "2021-12-27T00:00:00Z", should: "2021 Week 52, Week of 2021/12/27. Year 2021, Month 12, Day 27"}, // Monday when Jan 1st is Saturday and it's a leap year - {now: "2032-12-27T00:00:00Z", should: "2032 Week 53, Week of 2032/12/27."}, + {now: "2032-12-27T00:00:00Z", should: "2032 Week 53, Week of 2032/12/27. Year 2032, Month 12, Day 27"}, // Monday when Jan 1st is Sunday - {now: "2022-12-26T00:00:00Z", should: "2022 Week 52, Week of 2022/12/26."}, + {now: "2022-12-26T00:00:00Z", should: "2022 Week 52, Week of 2022/12/26. Year 2022, Month 12, Day 26"}, // Wednesday when Jan 1st is Wednesday - {now: "2020-01-01T00:00:00Z", should: "2020 Week 01, Week of 2019/12/30."}, + {now: "2020-01-01T00:00:00Z", should: "2020 Week 01, Week of 2019/12/30. Year 2020, Month 01, Day 01"}, } for _, v := range testCases { @@ -40,9 +40,9 @@ func TestNewDate(t *testing.T) { t.Fatal(err) } d := NewDate(now) - current := fmt.Sprintf("%v Week %v, Week of %v.", d.WeekNumberYear, d.WeekNumber, d.WeekStartDate) + current := fmt.Sprintf("%v Week %v, Week of %v. Year %v, Month %v, Day %v", d.WeekNumberYear, d.WeekNumber, d.WeekStartDate, d.Year, d.Month, d.Day) if current != v.should { - t.Errorf("Actual: %v, Should: %v\n", current, v.should) + t.Fatalf("Actual: %v, Should: %v\n", current, v.should) } } }