diff options
| author | Grant Ammons <gammons@gmail.com> | 2017-03-07 08:11:13 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-07 08:11:13 -0500 |
| commit | 34931b46ed9ebb06e9555d6e62c98c70dc460d59 (patch) | |
| tree | 7abefe0115f24ea94a007827a8e8239198b3e585 /todolist/parser_test.go | |
| parent | 7e50f18e5ed99abb58d3235b0060fc11ba9aa83d (diff) | |
| parent | ee5353cf832a2fec57eacb77396a443e6d6a5b9e (diff) | |
Merge pull request #35 from DmitriyMV/fix/time
Remove github.com/jinzhu/now.
Diffstat (limited to 'todolist/parser_test.go')
| -rw-r--r-- | todolist/parser_test.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/todolist/parser_test.go b/todolist/parser_test.go index 791958c..cbb94e8 100644 --- a/todolist/parser_test.go +++ b/todolist/parser_test.go @@ -6,7 +6,6 @@ import ( "testing" "time" - "github.com/jinzhu/now" "github.com/stretchr/testify/assert" ) @@ -75,11 +74,11 @@ func TestParseContexts(t *testing.T) { func TestDueToday(t *testing.T) { parser := &Parser{} todo := parser.ParseNewTodo("do this thing with @bob and @mary due today") - if todo.Due != now.BeginningOfDay().Format("2006-01-02") { + if todo.Due != bod(time.Now()).Format("2006-01-02") { fmt.Println("Date is different", todo.Due, time.Now()) } todo = parser.ParseNewTodo("do this thing with @bob and @mary due tod") - if todo.Due != now.BeginningOfDay().Format("2006-01-02") { + if todo.Due != bod(time.Now()).Format("2006-01-02") { fmt.Println("Date is different", todo.Due, time.Now()) } } @@ -87,11 +86,11 @@ func TestDueToday(t *testing.T) { func TestDueTomorrow(t *testing.T) { parser := &Parser{} todo := parser.ParseNewTodo("do this thing with @bob and @mary due tomorrow") - if todo.Due != now.BeginningOfDay().AddDate(0, 0, 1).Format("2006-01-02") { + if todo.Due != bod(time.Now()).AddDate(0, 0, 1).Format("2006-01-02") { fmt.Println("Date is different", todo.Due, time.Now()) } todo = parser.ParseNewTodo("do this thing with @bob and @mary due tom") - if todo.Due != now.BeginningOfDay().AddDate(0, 0, 1).Format("2006-01-02") { + if todo.Due != bod(time.Now()).AddDate(0, 0, 1).Format("2006-01-02") { fmt.Println("Date is different", todo.Due, time.Now()) } } |
