本文整理匯總了Golang中github.com/evergreen-ci/evergreen/model.Task.DisplayName方法的典型用法代碼示例。如果您正苦於以下問題:Golang Task.DisplayName方法的具體用法?Golang Task.DisplayName怎麽用?Golang Task.DisplayName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/evergreen-ci/evergreen/model.Task
的用法示例。
在下文中一共展示了Task.DisplayName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestTaskToJQL
func TestTaskToJQL(t *testing.T) {
Convey("Given a task with with two failed tests and one successful test, "+
"the jql should contian only the failed test names", t, func() {
task1 := model.Task{}
task1.TestResults = []model.TestResult{
{Status: "fail", TestFile: "foo.js"},
{Status: "success", TestFile: "bar.js"},
{Status: "fail", TestFile: "baz.js"},
}
task1.DisplayName = "foobar"
jQL1 := taskToJQL(&task1)
referenceJQL1 := fmt.Sprintf(JQLBFQuery, "summary~\"foo.js\" or summary~\"baz.js\"")
So(jQL1, ShouldEqual, referenceJQL1)
})
Convey("Given a task with with oo failed tests, "+
"the jql should contian only the failed task name", t, func() {
task2 := model.Task{}
task2.TestResults = []model.TestResult{}
task2.DisplayName = "foobar"
jQL2 := taskToJQL(&task2)
referenceJQL2 := fmt.Sprintf(JQLBFQuery, "summary~\"foobar\"")
So(jQL2, ShouldEqual, referenceJQL2)
})
}