use max step len of background & scenario outline
in order to avoid panic in printStep (line 217) also for scenario outlines. Updates #42
Этот коммит содержится в:
родитель
65ace21dc8
коммит
7d11af4218
1 изменённых файлов: 3 добавлений и 0 удалений
|
@ -269,6 +269,9 @@ func (f *pretty) printStepKind(res *stepResult) {
|
||||||
// first step of outline scenario, print header and calculate comment position
|
// first step of outline scenario, print header and calculate comment position
|
||||||
case f.outline != nil && f.steps == len(f.outline.Steps):
|
case f.outline != nil && f.steps == len(f.outline.Steps):
|
||||||
f.commentPos = f.longestStep(f.outline.Steps, f.length(f.outline))
|
f.commentPos = f.longestStep(f.outline.Steps, f.length(f.outline))
|
||||||
|
if bgLen := f.longestStep(f.feature.Background.Steps, f.length(f.feature.Background)); bgLen > f.commentPos {
|
||||||
|
f.commentPos = bgLen
|
||||||
|
}
|
||||||
text := s(f.indent) + bcl(f.outline.Keyword+": ", white) + f.outline.Name
|
text := s(f.indent) + bcl(f.outline.Keyword+": ", white) + f.outline.Name
|
||||||
text += s(f.commentPos-f.length(f.outline)+1) + f.line(f.outline.Location)
|
text += s(f.commentPos-f.length(f.outline)+1) + f.line(f.outline.Location)
|
||||||
fmt.Println("\n" + text)
|
fmt.Println("\n" + text)
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче