未验证 提交 63e8cec4 编写于 作者: P Phodal Huang

test: add test for todo

上级 dd086f5b
package todo
import parser "github.com/phodal/coca/languages/java"
type EmptyListener struct {
parser.BaseJavaParserListener
}
func NewEmptyListener() *EmptyListener {
return &EmptyListener{}
}
......@@ -24,3 +24,16 @@ func TestNewTodoApp(t *testing.T) {
g.Expect(todos[1].Message[0]).To(Equal("add more content"))
g.Expect(todos[1].Assignee).To(Equal("phodal"))
}
func Test_ShouldReturnNullWhenNotTodo(t *testing.T) {
g := NewGomegaWithT(t)
codePath := "../../../_fixtures/tbs"
codePath = filepath.FromSlash(codePath)
app := NewTodoApp()
stodos := app.AnalysisPath(codePath)
todos := app.BuildWithGitHistory(stodos)
g.Expect(len(todos)).To(Equal(0))
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册