From 50d0119567d2dcae7729bf4e7a841702ba9171d0 Mon Sep 17 00:00:00 2001 From: Quey-Liang Kao Date: Thu, 26 Jan 2017 20:42:37 +0800 Subject: Support UTF-8 strings as contexts and projects --- todolist/parser_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'todolist/parser_test.go') diff --git a/todolist/parser_test.go b/todolist/parser_test.go index 15307cc..791958c 100644 --- a/todolist/parser_test.go +++ b/todolist/parser_test.go @@ -37,13 +37,15 @@ func TestParseExpandProjects(t *testing.T) { assert.Equal("", wrongFormat2) wrongFormat3 := parser.ExpandProject("ex 116 meeting figures, slides, coffee, suger") assert.Equal("", wrongFormat3) + wrongFormat4 := parser.ExpandProject("ex 117 +重要な會議: 図, コーヒー, 砂糖") + assert.Equal("+重要な會議", wrongFormat4) } func TestParseProjects(t *testing.T) { parser := &Parser{} - todo := parser.ParseNewTodo("do this thing +proj1 +proj2 due tomorrow") - if len(todo.Projects) != 2 { - t.Error("Expected Projects length to be 2") + todo := parser.ParseNewTodo("do this thing +proj1 +proj2 +專案3 due tomorrow") + if len(todo.Projects) != 3 { + t.Error("Expected Projects length to be 3") } if todo.Projects[0] != "proj1" { t.Error("todo.Projects[0] should equal 'proj1' but got", todo.Projects[0]) @@ -51,6 +53,9 @@ func TestParseProjects(t *testing.T) { if todo.Projects[1] != "proj2" { t.Error("todo.Projects[1] should equal 'proj2' but got", todo.Projects[1]) } + if todo.Projects[2] != "專案3" { + t.Error("todo.Projects[2] should equal '專案3' but got", todo.Projects[2]) + } } func TestParseContexts(t *testing.T) { -- cgit v1.3