spockframework / spockframework/spock

data tables should support proper line numbers for debugging

Open
#208 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Module-Core Type-Enhancement
Dominant language
Java
Stars
3.6k
Forks
483
PR merge metrics
No merged PRs in 30d

Description

Originally reported on Google Code with ID 86

I am using some Data Tables from the 0.4 release, using the sample
from the blog:

01    def "maximum of two numbers"() {
02        expect:
03            Math.max(a, b) == c
04
05        where:
06            a | b | c
07            3 | 7 | 7
08            5 | 4 | 5
09            9 | 9 | 9
10    }

(hopefully, this email is monospaced to you as well)

When using this feature in a debugger, Line 6 is executed 3 times and
line 3 3 times.
It would be nice if line 6 were not executed 3 times and instead line
7, 8, and 8 were executed once.

I think there might be some way to do this by filling in the line
number field inside your AST transformation.

Changing this would make debugging a lot easier.

Reported by HamletDRC on 2010-03-21 17:45:31

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the data-table AST transformation and how it assigns line-number information, then reproduce the sample data table in a debugger. Done means the individual data rows, rather than the table declaration line, receive the executions' source line numbers.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
developer-experience, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.