From 91c11630ef1e0a5394754def253876507ac8b94d Mon Sep 17 00:00:00 2001 From: Rodrigo Dumont Date: Sat, 25 Mar 2017 18:27:26 -0300 Subject: Adds support to projects with hyphen --- todolist/parser_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'todolist/parser_test.go') diff --git a/todolist/parser_test.go b/todolist/parser_test.go index cbb94e8..8cd6b53 100644 --- a/todolist/parser_test.go +++ b/todolist/parser_test.go @@ -42,8 +42,8 @@ func TestParseExpandProjects(t *testing.T) { func TestParseProjects(t *testing.T) { parser := &Parser{} - todo := parser.ParseNewTodo("do this thing +proj1 +proj2 +專案3 due tomorrow") - if len(todo.Projects) != 3 { + todo := parser.ParseNewTodo("do this thing +proj1 +proj2 +專案3 +proj-name due tomorrow") + if len(todo.Projects) != 4 { t.Error("Expected Projects length to be 3") } if todo.Projects[0] != "proj1" { @@ -55,6 +55,9 @@ func TestParseProjects(t *testing.T) { if todo.Projects[2] != "專案3" { t.Error("todo.Projects[2] should equal '專案3' but got", todo.Projects[2]) } + if todo.Projects[3] != "proj-name" { + t.Error("todo.Projects[3] should equal 'proj-name' but got", todo.Projects[3]) + } } func TestParseContexts(t *testing.T) { -- cgit v1.3