diff --git a/formatter_test.go b/formatter_test.go index 1b55ae5..03f867f 100644 --- a/formatter_test.go +++ b/formatter_test.go @@ -5,6 +5,7 @@ import ( "io" "strings" "testing" + "time" "unsafe" ) @@ -259,3 +260,13 @@ func TestCycle(t *testing.T) { *iv = *i t.Logf("Example long interface cycle:\n%# v", Formatter(i)) } + +func TestTime(t *testing.T) { + date := time.Date(2006, 1, 2, 3, 4, 5, .678901e9, time.Local) + d, _ := date.MarshalText() + s := fmt.Sprintf("%# v", Formatter(date)) + + if s != string(d) { + t.Errorf("expected %s, got %s", string(d), s) + } +}