tpl: Update dateFormat test expectations for epoch values
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 25 Dec 2016 13:53:34 +0000 (14:53 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 25 Dec 2016 13:53:34 +0000 (14:53 +0100)
As `Cast` now supports `int` inputs.

tpl/template_funcs_test.go

index 0f3519e2daf925fffca76e6697300e69587594bf..f74266b36f3f8c8def8326f51cf70a3013156329 100644 (file)
@@ -2272,7 +2272,7 @@ func TestDateFormat(t *testing.T) {
                {"Monday, Jan 2, 2006", "2015-01-21", "Wednesday, Jan 21, 2015"},
                {"Monday, Jan 2, 2006", time.Date(2015, time.January, 21, 0, 0, 0, 0, time.UTC), "Wednesday, Jan 21, 2015"},
                {"This isn't a date layout string", "2015-01-21", "This isn't a date layout string"},
-               {"Monday, Jan 2, 2006", 1421733600, false},
+               {"Monday, Jan 2, 2006", 1421733600, "Tuesday, Jan 20, 2015"},
                {"Monday, Jan 2, 2006", 1421733600.123, false},
                {time.RFC3339, time.Date(2016, time.March, 3, 4, 5, 0, 0, time.UTC), "2016-03-03T04:05:00Z"},
                {time.RFC1123, time.Date(2016, time.March, 3, 4, 5, 0, 0, time.UTC), "Thu, 03 Mar 2016 04:05:00 UTC"},
@@ -2282,7 +2282,7 @@ func TestDateFormat(t *testing.T) {
                result, err := dateFormat(this.layout, this.value)
                if b, ok := this.expect.(bool); ok && !b {
                        if err == nil {
-                               t.Errorf("[%d] DateFormat didn't return an expected error", i)
+                               t.Errorf("[%d] DateFormat didn't return an expected error, got %v", i, result)
                        }
                } else {
                        if err != nil {