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

Add assertions utilities #7

Open
bitwizeshift opened this issue Mar 16, 2023 · 1 comment
Open

Add assertions utilities #7

bitwizeshift opened this issue Mar 16, 2023 · 1 comment
Labels
✨ Feature New feature being added

Comments

@bitwizeshift
Copy link
Owner

Blocked by #6

The builtin assertions are lackluster for testing in that they only cover assert_eq, assert_ne, assert, and assert_match (nightly). Ideally we should have the full collection of unit test assertion helpers like mature unit test libraries have, such as GTest.

This is to track adding assertions for eq, ne, true, false, regex, match, etc.
These should make use of the test-return-types, which also enables adding simple succeed!() and fail!() macros.

@bitwizeshift bitwizeshift added the ✨ Feature New feature being added label Mar 16, 2023
@bitwizeshift bitwizeshift changed the title Add assertions library Add assertions utilities Mar 16, 2023
@bitwizeshift
Copy link
Owner Author

As per #15, this might need to be revisited at a later time.

Alternatively, both assertions and non-panicking-assertions can be provided. For example, perhaps doing:

  • assert_* -> treated as a panic-based assert (like assert!(...) is in the standard), and
  • require_* -> treated as a non-panicking-based assert, usable in all non should_panic tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature New feature being added
Projects
None yet
Development

No branches or pull requests

1 participant