Генерённые функции ничего не возвращают

Этот коммит содержится в:
Softonik 2022-11-25 21:09:02 +03:00 коммит произвёл Nikolay Kopitonenko
родитель 6c3e2a2103
коммит 8dbd7d2175
9 изменённых файлов: 25 добавлений и 47 удалений

Просмотреть файл

@ -295,12 +295,10 @@ Feature: pretty formatter
You can implement step definitions for undefined steps with these snippets:
func undefinedDocString(arg1 *godog.DocString) error {
return godog.ErrPending
func undefinedDocString(arg1 *godog.DocString) {
}
func undefinedTable(arg1 *godog.Table) error {
return godog.ErrPending
func undefinedTable(arg1 *godog.Table) {
}
func InitializeScenario(ctx *godog.ScenarioContext) {

Просмотреть файл

@ -20,12 +20,10 @@ Feature: undefined step snippets
"""
And the undefined step snippets should be:
"""
func iSendRequestTo(arg1, arg2 string) error {
return godog.ErrPending
func iSendRequestTo(arg1, arg2 string) {
}
func theResponseCodeShouldBe(arg1 int) error {
return godog.ErrPending
func theResponseCodeShouldBe(arg1 int) {
}
func InitializeScenario(ctx *godog.ScenarioContext) {
@ -52,16 +50,13 @@ Feature: undefined step snippets
When I run feature suite
Then the undefined step snippets should be:
"""
func iSendRequestToWith(arg1, arg2 string, arg3 *godog.Table) error {
return godog.ErrPending
func iSendRequestToWith(arg1, arg2 string, arg3 *godog.Table) {
}
func theResponseBodyShouldBe(arg1 *godog.DocString) error {
return godog.ErrPending
func theResponseBodyShouldBe(arg1 *godog.DocString) {
}
func theResponseCodeShouldBeAndHeaderShouldBe(arg1 int, arg2, arg3 string) error {
return godog.ErrPending
func theResponseCodeShouldBeAndHeaderShouldBe(arg1 int, arg2, arg3 string) {
}
func InitializeScenario(ctx *godog.ScenarioContext) {
@ -88,12 +83,10 @@ Feature: undefined step snippets
"""
And the undefined step snippets should be:
"""
func iPullFromGithubcom() error {
return godog.ErrPending
func iPullFromGithubcom() {
}
func theProjectShouldBeThere() error {
return godog.ErrPending
func theProjectShouldBeThere() {
}
func InitializeScenario(ctx *godog.ScenarioContext) {
@ -114,12 +107,10 @@ Feature: undefined step snippets
When I run feature suite
And the undefined step snippets should be:
"""
func iAddTheToTheBasket(arg1 string) error {
return godog.ErrPending
func iAddTheToTheBasket(arg1 string) {
}
func thereIsAWhichCosts(arg1 string, arg2 int) error {
return godog.ErrPending
func thereIsAWhichCosts(arg1 string, arg2 int) {
}
func InitializeScenario(ctx *godog.ScenarioContext) {
@ -140,12 +131,10 @@ Feature: undefined step snippets
When I run feature suite
And the undefined step snippets should be:
"""
func godogs(arg1 int) error {
return godog.ErrPending
func godogs(arg1 int) {
}
func whichCosts(arg1 string, arg2 int) error {
return godog.ErrPending
func whichCosts(arg1 string, arg2 int) {
}
func InitializeScenario(ctx *godog.ScenarioContext) {
@ -175,16 +164,13 @@ Feature: undefined step snippets
"""
And the undefined step snippets should be:
"""
func получаетсяЕщёБолееЧтото() error {
return godog.ErrPending
func получаетсяЕщёБолееЧтото() {
}
func чтото() error {
return godog.ErrPending
func чтото() {
}
func яДелаюЕщёЧтото() error {
return godog.ErrPending
func яДелаюЕщёЧтото() {
}
func InitializeScenario(ctx *godog.ScenarioContext) {

Просмотреть файл

@ -229,6 +229,7 @@ func (f *Base) Snippets() string {
w = strings.Title(w)
case len(w) > 0:
r := []rune(w)
// tut
w = string(unicode.ToLower(r[0])) + string(r[1:])
}
words = append(words, w)

Просмотреть файл

@ -26,4 +26,4 @@
{"event":"TestStepStarted","location":"formatter-tests/features/some_scenarions_including_failing.feature:14","timestamp":-6795364578871}
{"event":"TestStepFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:14","timestamp":-6795364578871,"status":"skipped"}
{"event":"TestCaseFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:12","timestamp":-6795364578871,"status":"undefined"}
{"event":"TestRunFinished","status":"failed","timestamp":-6795364578871,"snippets":"You can implement step definitions for undefined steps with these snippets:\n\nfunc undefined() error {\n\treturn godog.ErrPending\n}\n\nfunc InitializeScenario(ctx *godog.ScenarioContext) {\n\tctx.Step(`^undefined$`, undefined)\n}\n","memory":""}
{"event":"TestRunFinished","status":"failed","timestamp":-6795364578871,"snippets":"You can implement step definitions for undefined steps with these snippets:\n\nfunc undefined() {\n}\n\nfunc InitializeScenario(ctx *godog.ScenarioContext) {\n\tctx.Step(`^undefined$`, undefined)\n}\n","memory":""}

Просмотреть файл

@ -44,8 +44,7 @@
<yellow>You can implement step definitions for undefined steps with these snippets:</yellow>
<yellow>
func undefined() error {
return godog.ErrPending
func undefined() {
}
func InitializeScenario(ctx *godog.ScenarioContext) {

Просмотреть файл

@ -28,8 +28,7 @@
<yellow>You can implement step definitions for undefined steps with these snippets:</yellow>
<yellow>
func undefined() error {
return godog.ErrPending
func undefined() {
}
func InitializeScenario(ctx *godog.ScenarioContext) {

Просмотреть файл

@ -14,8 +14,7 @@
<yellow>You can implement step definitions for undefined steps with these snippets:</yellow>
<yellow>
func undefined() error {
return godog.ErrPending
func undefined() {
}
func InitializeScenario(ctx *godog.ScenarioContext) {

Просмотреть файл

@ -23,8 +23,7 @@ var snippetHelperFuncs = template.FuncMap{
}
var undefinedSnippetsTpl = template.Must(template.New("snippets").Funcs(snippetHelperFuncs).Parse(`
{{ range . }}func {{ .Method }}({{ .Args }}) error {
return godog.ErrPending
{{ range . }}func {{ .Method }}({{ .Args }}) {
}
{{end}}func InitializeScenario(ctx *godog.ScenarioContext) { {{ range . }}

Просмотреть файл

@ -133,16 +133,13 @@ func Test_ProgressFormatterMultistepTemplates(t *testing.T) {
You can implement step definitions for undefined steps with these snippets:
func three() error {
return godog.ErrPending
func three() {
}
func unavailableCost(arg1 string, arg2 int) error {
return godog.ErrPending
func unavailableCost(arg1 string, arg2 int) {
}
func undef() error {
return godog.ErrPending
func undef() {
}
func InitializeScenario(ctx *godog.ScenarioContext) {