aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/parser_test.go
diff options
context:
space:
mode:
authorMichael Strùˆder <mikezter@gmail.com>2017-05-03 15:18:13 +0200
committerGrant Ammons <gammons@gmail.com>2017-05-09 20:20:24 -0400
commitfdca747e173c20f59901207c3f1887cece2a9351 (patch)
tree7eda8ee6456d3bb89c980bbec9bcfcaacd06dfdd /todolist/parser_test.go
parent2c5512341a8c87dfe4d37106a1ecc02784e84da6 (diff)
subcommands like delete don't take a subject, so make it optional
Diffstat (limited to 'todolist/parser_test.go')
-rw-r--r--todolist/parser_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/todolist/parser_test.go b/todolist/parser_test.go
index 05f390a..4466489 100644
--- a/todolist/parser_test.go
+++ b/todolist/parser_test.go
@@ -170,6 +170,16 @@ func TestDueIntelligentlyChoosesCorrectYear(t *testing.T) {
assert.Equal("2017-01-10", parser.parseArbitraryDate("jan 10", decemberTime))
}
+func TestParseCommandIdSubjectOptionalSubject(t *testing.T) {
+ assert := assert.New(t)
+ parser := Parser{"d 24"}
+ command, id, subject := parser.Parse()
+
+ assert.Equal("d", command)
+ assert.Equal(24, id)
+ assert.Equal("", subject)
+}
+
func TestParseCommandIdSubjectWhitespace(t *testing.T) {
assert := assert.New(t)
parser := Parser{"es 24\t a new subject"}