Skip to content

Conversation

@skogseth
Copy link
Contributor

The tests use the trybuild crate to check that compilation fails for the incorrect macro use. The test will also fail if the error output changes.

These were added directly to the tests directory (as opposed to being part of the testsuite subdirectory) because the automatic check and overwrite functionality provided by the trybuild crate seemed to not work properly when placed there.

Fixes #157

@coveralls
Copy link

coveralls commented Nov 13, 2025

Pull Request Test Coverage Report for Build 19365796251

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 31.891%

Totals Coverage Status
Change from base Build 19172364394: 0.0%
Covered Lines: 538
Relevant Lines: 1687

💛 - Coveralls

@skogseth
Copy link
Contributor Author

I think these tests also show how there's definitely some room for improvements in the error messages

@epage
Copy link
Collaborator

epage commented Nov 13, 2025

Some more cases. Feel free to add or I'll do it in a follow up

  • Unsupported return type
  • Unsupported T for Result<T, E> type
  • Unsupported E for Result<T, E> type
  • Unsupported parameter

@skogseth
Copy link
Contributor Author

I can add those 👍

The tests use the `trybuild` crate to check that compilation
fails for the incorrect macro use. The test will also fail
if the error output changes.

These were added directly to the `tests` directory
(as opposed to being part of the `testsuite` subdirectory)
because the automatic check and overwrite functionality 
provided by the `trybuild` crate seemed to not work properly
when placed there.
@epage
Copy link
Collaborator

epage commented Nov 14, 2025

Thanks!

@epage epage merged commit 31399f6 into assert-rs:main Nov 14, 2025
17 checks passed
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.

Add tests for error output of macros

3 participants