aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/parser_test.go
diff options
context:
space:
mode:
authorQuey-Liang Kao <nonerkao@gmail.com>2017-01-26 20:42:37 +0800
committerQuey-Liang Kao <nonerkao@gmail.com>2017-01-26 20:42:37 +0800
commit50d0119567d2dcae7729bf4e7a841702ba9171d0 (patch)
tree5f7beaed61bd161a2d3b593c7f9136bf18fa889c /todolist/parser_test.go
parentbfd33a9904daac273ff2b708d02c738be276b8c7 (diff)
Support UTF-8 strings as contexts and projects
Diffstat (limited to 'todolist/parser_test.go')
-rw-r--r--todolist/parser_test.go11
1 files changed, 8 insertions, 3 deletions
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) {