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

ErrorMessagesSpec: make failures easier to read #286

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

generalmimon
Copy link
Member

Old output of sbt test:

ErrorMessagesSpec:
- attr_invalid_switch_inner *** FAILED ***
  attr_invalid_switch_inner.ksy: /seq/1/size:
  	error: invalid type: expected integer, got CalcBooleanType

  attr_invalid_switch_inner.ksy: /seq/1/size:
  	error: invalid type: expected integer, got CalcBooleanType
   did not equal attr_invalid_switch_inner.ksy: /seq/1/size:
  	error: invalid type: expected integer, got CalcBooleanType (SimpleMatchers.scala:34)

New output of sbt test:

ErrorMessagesSpec:
- attr_invalid_switch_inner *** FAILED ***
  [attr_invalid_switch_inner.ksy: /seq/1/size:
         error: invalid type: expected integer, got CalcBooleanType

  attr_invalid_switch_inner.ksy: /seq/1/size:
         error: invalid type: expected integer, got CalcBooleanType
  ]
    did not equal
  [attr_invalid_switch_inner.ksy: /seq/1/size:
         error: invalid type: expected integer, got CalcBooleanType
  ] (SimpleMatchers.scala:34)

Old output of `sbt test`:

```
ErrorMessagesSpec:
- attr_invalid_switch_inner *** FAILED ***
  attr_invalid_switch_inner.ksy: /seq/1/size:
  	error: invalid type: expected integer, got CalcBooleanType

  attr_invalid_switch_inner.ksy: /seq/1/size:
  	error: invalid type: expected integer, got CalcBooleanType
   did not equal attr_invalid_switch_inner.ksy: /seq/1/size:
  	error: invalid type: expected integer, got CalcBooleanType (SimpleMatchers.scala:34)
```

New output of `sbt test`:

```
ErrorMessagesSpec:
- attr_invalid_switch_inner *** FAILED ***
  [attr_invalid_switch_inner.ksy: /seq/1/size:
         error: invalid type: expected integer, got CalcBooleanType

  attr_invalid_switch_inner.ksy: /seq/1/size:
         error: invalid type: expected integer, got CalcBooleanType
  ]
    did not equal
  [attr_invalid_switch_inner.ksy: /seq/1/size:
         error: invalid type: expected integer, got CalcBooleanType
  ] (SimpleMatchers.scala:34)
```
Copy link
Member

@GreyCat GreyCat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! Ideally, we should expense this further to somehow avoid "useful" string diffing with [] markup in them, which confuses GUI diff parsers and makes it very awkward to just copy verbatim values.

@generalmimon generalmimon merged commit f93fa66 into master Mar 22, 2024
3 of 6 checks passed
@generalmimon generalmimon deleted the nicer-errormessagesspec branch March 22, 2024 22:45
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.

2 participants