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

[TEST] Promote interceptContians usage for exception message assertions #5413

Closed

Conversation

bowenliang123
Copy link
Contributor

@bowenliang123 bowenliang123 commented Oct 13, 2023

Why are the changes needed?

  • Apply interceptContians usage for exception message assertions
  • Increase readability and productivity in the code styling
interceptContians[Exception]{    // intercepted exception class
   ...                                         // logic code
} ("expected string")                    // asserted containing string

or inlined assertion
`interceptContiansException("expected string")

  • Avoid using meaningless assignments in exception instances with/without index number, such as val e = ..., val e2 = ...
  • Introduce interceptStartsWith method for assertion for the prefixed exception message

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before make a pull request

Was this patch authored or co-authored using generative AI tooling?

No.

@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2023

Codecov Report

Merging #5413 (a6b47f1) into master (c4cdf18) will not change coverage.
Report is 1 commits behind head on master.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           master   #5413   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files         588     588           
  Lines       33466   33466           
  Branches     4401    4401           
======================================
  Misses      33466   33466           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bowenliang123 bowenliang123 marked this pull request as ready for review October 19, 2023 16:26
@bowenliang123 bowenliang123 deleted the intercept-contains branch November 24, 2023 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants