diff options
| author | Quey-Liang Kao <s101062801@m101.nthu.edu.tw> | 2017-08-29 17:19:11 +0800 |
|---|---|---|
| committer | Quey-Liang Kao <s101062801@m101.nthu.edu.tw> | 2017-08-29 17:19:11 +0800 |
| commit | 0c2a2f99a9cdcc9acb7d55807330801d58d4c632 (patch) | |
| tree | 302df4b2d027d77c9b4bb02a44b48d32fc9bb064 /todolist | |
| parent | f9a98c7aa2d92b931c2ce34d188d9be390f4e2dc (diff) | |
Add test function TestAddEmptyTodo
Diffstat (limited to 'todolist')
| -rw-r--r-- | todolist/app_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/todolist/app_test.go b/todolist/app_test.go index 2fb7717..360da43 100644 --- a/todolist/app_test.go +++ b/todolist/app_test.go @@ -44,6 +44,18 @@ func TestAddTodoWithEuropeanDates(t *testing.T) { assert.Equal([]string{}, todo.Contexts) } +func TestAddEmptyTodo(t *testing.T) { + assert := assert.New(t) + app := &App{TodoList: &TodoList{}, TodoStore: &MemoryStore{}} + + app.AddTodo("a") + app.AddTodo("a ") + app.AddTodo("a\t\t\t\t") + app.AddTodo("a\t \t \t \t") + + assert.Equal(len(app.TodoList.Data), 0) +} + func TestListbyProject(t *testing.T) { assert := assert.New(t) app := &App{TodoList: &TodoList{}, TodoStore: &MemoryStore{}} |
