From 1998268a1c31c54b8085bab7fac267bc1fdee57d Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 31 Aug 2013 15:05:03 -0400 Subject: [PATCH] go fmt'ed --- cronexpr_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cronexpr_test.go b/cronexpr_test.go index da84633..e9f0e1d 100644 --- a/cronexpr_test.go +++ b/cronexpr_test.go @@ -116,8 +116,21 @@ func TestExpressions(t *testing.T) { next := cronexpr.Parse(test.expr).Next(from) nextstr := next.Format(test.layout) if nextstr != times.next { - t.Errorf("(\"%s\").Next(\"%s\") = \"%s\", got \"%s\"", test.expr, times.from, times.next, nextstr) + t.Errorf(`("%s").Next("%s") = "%s", got "%s"`, test.expr, times.from, times.next, nextstr) } } } } + +func TestZero(t *testing.T) { + from, _ := time.Parse("2006-01-02", "2013-08-31") + next := cronexpr.Parse("* * * * * 1980").Next(from) + if next.IsZero() == false { + t.Error(`("* * * * * 1980").Next("2013-08-31") returned 'false', expected 'true'`) + } + + next = cronexpr.Parse("* * * * * 2050").Next(from) + if next.IsZero() == true { + t.Error(`("* * * * * 2050").Next("2013-08-31") returned 'true', expected 'false'`) + } +}