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 a test suite #3451

Closed
watzon opened this issue Jan 15, 2020 · 6 comments
Closed

Add a test suite #3451

watzon opened this issue Jan 15, 2020 · 6 comments
Labels
Feature/Enhancement Request This issue is made to request a feature or an enhancement to an existing one. Status: Duplicate This issue has been marked as a duplicate of another issue.

Comments

@watzon
Copy link
Contributor

watzon commented Jan 15, 2020

Currently we have access to one "test method" as far as I can tell, and that's assert. It's nice to have, but there's only so much you can do with it. It would be nice to have a more fully featured test suite built in so that we could do things like:

assert_eq(foo, bar)
assert_panics(im_broken())
assert_not_empty(some_array)
// etc etc

This would be extremely helpful, especially when it comes to debugging tests since currently assert doesn't actually tell you what the value was that made the assertion failed. It just panics and tells you the line.

@watzon watzon added the Feature/Enhancement Request This issue is made to request a feature or an enhancement to an existing one. label Jan 15, 2020
@medvednikov
Copy link
Member

assert_eq is already here (assert)
assert_non_empty is just assert some_array.len == 0

assert_panics I agree with.

@medvednikov
Copy link
Member

doesn't actually tell you what the value was that made the assertion failed.

this will be fixed soon

@watzon
Copy link
Contributor Author

watzon commented Jan 15, 2020

doesn't actually tell you what the value was that made the assertion failed.

this will be fixed soon

I just figured something like this would require an assert_eq type function, unless it's all compiler magic. Either way that's the main thing I want. Saves a lot of debugging time.

@medvednikov
Copy link
Member

Yes, this will be compiler magic :)

Assert is a builtin keyword.

@watzon
Copy link
Contributor Author

watzon commented Jan 15, 2020

Yes, this will be compiler magic :)

Assert is a builtin keyword.

I figured as much. Any reason to not keep assert but also have a test suite built on top of it that's a little more flexible and easy to modify? Compiler internals are a little harder to contribute to, especially for newcommers.

@chanbakjsd
Copy link
Contributor

This feature request is a duplicate of #9.

@chanbakjsd chanbakjsd added the Status: Duplicate This issue has been marked as a duplicate of another issue. label Jan 17, 2020
@nedpals nedpals reopened this May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature/Enhancement Request This issue is made to request a feature or an enhancement to an existing one. Status: Duplicate This issue has been marked as a duplicate of another issue.
Projects
None yet
Development

No branches or pull requests

5 participants