Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve diff table output #3671

Merged
merged 1 commit into from
Feb 8, 2017
Merged

Improve diff table output #3671

merged 1 commit into from
Feb 8, 2017

Conversation

emiltin
Copy link
Contributor

@emiltin emiltin commented Feb 7, 2017

Issue

Improves cucumber diff table output, by showing which cells was wrong: Instead of showing (-) and (+) in all columns, only show it in the columns with wrong results.

Before:

     Tables were not identical:
     |     highway |     junction   |     oneway |     oneway:bicycle |     forw |     backw |
     |     primary |                |     yes    |     yes            |     x    |           |
     | (-) primary | (-)            | (-) yes    | (-) no             | (-)      | (-) x     |
     | (+) primary | (+)            | (+) yes    | (+) no             | (+) x    | (+)       |
     |     primary |                |     yes    |     -1             |     x    |           |
     |     primary |                |     no     |     yes            |     x    |     x     |
     |     primary |                |     no     |     no             |     x    |     x     |
     |     primary |                |     no     |     -1             |     x    |     x     |
     | (-) primary | (-)            | (-) -1     | (-) yes            | (-)      | (-)       |
     | (+) primary | (+)            | (+) -1     | (+) yes            | (+)      | (+) x     |
     |     primary |                |     -1     |     no             |          |     x     |
     |     primary |                |     -1     |     -1             |          |     x     |
     |     primary |     roundabout |            |     yes            |     x    |           |
     | (-) primary | (-) roundabout | (-)        | (-) no             | (-) x    | (-) x     |
     | (+) primary | (+) roundabout | (+)        | (+) no             | (+) x    | (+)       |
     |     primary |     roundabout |            |     -1             |     x    |           |

After:

     Tables were not identical:
     | highway | junction   | oneway | oneway:bicycle |     forw |     backw |
     | primary |            | yes    | yes            |     x    |           |
     | primary |            | yes    | no             | (-)      | (-) x     |
     | primary |            | yes    | no             | (+) x    | (+)       |
     | primary |            | yes    | -1             |     x    |           |
     | primary |            | no     | yes            |     x    |     x     |
     | primary |            | no     | no             |     x    |     x     |
     | primary |            | no     | -1             |     x    |     x     |
     | primary |            | -1     | yes            |          | (-)       |
     | primary |            | -1     | yes            |          | (+) x     |
     | primary |            | -1     | no             |          |     x     |
     | primary |            | -1     | -1             |          |     x     |
     | primary | roundabout |        | yes            |     x    |           |
     | primary | roundabout |        | no             |     x    | (-) x     |
     | primary | roundabout |        | no             |     x    | (+)       |
     | primary | roundabout |        | -1             |     x    |           |

The colors can't be seen in the text above, but is unchanged, except I changed the color of the headers to gray.

@daniel-j-h
Copy link
Member

Sweet!

Just asking here out of interest, but is this related to cucumber/cucumber-js#534 not being implemented upstream - and if so should these changes be made to cucumber-js instead?

@TheMarex
Copy link
Member

TheMarex commented Feb 7, 2017

Yes this should live upstream eventually, but for that our whole diff code would need to be ported. Not sure how much effort that would be.

@TheMarex TheMarex merged commit ef4d32a into master Feb 8, 2017
@TheMarex TheMarex deleted the improve_cuke_diff_tables branch February 8, 2017 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants