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

show only failing sub assertions in a summary assertion group #724

Open
robstoll opened this issue Dec 20, 2020 · 2 comments
Open

show only failing sub assertions in a summary assertion group #724

robstoll opened this issue Dec 20, 2020 · 2 comments
Assignees
Milestone

Comments

@robstoll
Copy link
Owner

Platform (all, jvm, js): all
Extension (none, kotlin 1.3): none

Code related feature

Consider the following reporting

expected that subject: {a=null, null=1, b=2}        (java.util.LinkedHashMap <1031246792>)
◆ contains only, in order: 
  ✔ ▶ element 0: a=null        (java.util.LinkedHashMap.Entry <1834736756>)
      ◾ ▶ key: "a"        <528658809>
          ◾ equals: "a"        <528658809>
      ◾ ▶ value: null
          ◾ equals: null
  ✘ ▶ element 1: null=1        (java.util.LinkedHashMap.Entry <601057428>)
      ◾ ▶ key: null
          ◾ equals: null
      ◾ ▶ value: 1        (kotlin.Int <1614645392>)
          ◾ is less than: 1        (kotlin.Int <1614645392>)

Atrium could be more helpful in spotting the error for element: 1 by only showing the failing assertions:

  ✘ ▶ element 1: null=1        (java.util.LinkedHashMap.Entry <601057428>)
      ◾ ▶ value: 1        (kotlin.Int <1614645392>)
          ◾ is less than: 1        (kotlin.Int <1614645392>)

Also, I think it would be enough if the successful assertions only show that an element was successful but not the assertions behind it. So after all improvements it would look like the following:

expected that subject: {a=null, null=1, b=2}        (java.util.LinkedHashMap <1031246792>)
◆ contains only, in order: 
  ✔ ▶ element 0: a=null        (java.util.LinkedHashMap.Entry <1834736756>)
  ✘ ▶ element 1: null=1        (java.util.LinkedHashMap.Entry <601057428>)
      ◾ ▶ value: 1        (kotlin.Int <1614645392>)
          ◾ is less than: 1        (kotlin.Int <1614645392>)

In the spirit of #292, it would make sense that one can configure the assertion function to show all assertions or not within the summary assertion group. But per default, sub assertions within an summary assertion group should only be shown if failing.

@jakubriegel
Copy link
Collaborator

Hi! I'll do it

@robstoll
Copy link
Owner Author

robstoll commented Oct 16, 2022

@jakubriegel thanks but this isn't an easy one and I will tackle it myself in the context of another change. Please focus on another issue if you want to support Atrium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants