cucumber / cucumber/godog

crash when run rule example in gherkin reference

Open
#490 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.7k
Forks
280
Avg merge
2d 20h
Merged PRs (30d)
2

Description

### 👓 What did you see?

run below feature crah
https://cucumber.io/docs/gherkin/reference/#keywords
`Feature: Highlander

Rule: There can be only One

Example: Only One -- More than one alive
Given there are 3 ninjas
And there are more than one ninja alive
When 2 ninjas meet, they will fight
Then one ninja dies (but not me)
And there is one ninja less alive

Example: Only One -- One alive
Given there is only 1 ninja alive
Then he (or she) will live forever ;-)`

`Feature: Highlander
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x1195855]

goroutine 1 [running]:
github.com/cucumber/godog/internal/formatters.(*Pretty).printStep(0xc000012b80, 0xc0002e8090, 0xc0002b8680)
/Users/long/go/pkg/mod/github.com/cucumber/godog@v0.12.5/internal/formatters/fmt_pretty.go:384 +0x6d5`
### ✅ What did you expect to see?
no crash

no crash
### 📦 Which tool/library version are you using?

0.12.5
### 🔬 How could we reproduce it?

Steps to reproduce the behavior:
1. Install '...' version '...'
2. Create a file called '....'
3. Run command '....'
4. See error '....'

### 📚 Any additional context?

----

*This text was originally generated from a [template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/about-issue-and-pull-request-templates), then edited by hand. [You can modify the template here.](https://github.com/cucumber/.github/edit/main/.github/ISSUE_TEMPLATE/bug_report.md)*

Contributor guide

Open the contributing guide

Research direction

Start by running the Rule and Example from the Gherkin reference with godog 0.12.5 and reproduce the reported panic. Inspect the stack-trace location in internal/formatters/fmt_pretty.go:384; done means the example runs without a nil-pointer crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.