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 proper compile-fail tests #55

Closed
LukasKalbertodt opened this issue Jul 16, 2019 · 2 comments · Fixed by #59
Closed

Add proper compile-fail tests #55

LukasKalbertodt opened this issue Jul 16, 2019 · 2 comments · Fixed by #59

Comments

@LukasKalbertodt
Copy link
Member

We already have compile-fail tests, but they in fact only check if compilation indeed fails. It does not check the error message at all. This is pretty unfortunate, because any other random failure can make the test pass.

See this PR for discussion on how one would do that. We probably want to use a crate that does it for us, but it's not clear which one.

@CreepySkeleton
Copy link
Contributor

CreepySkeleton commented Oct 30, 2019

You should take a look at trybuild crate, it does not only perform "compiles or not" check but also validates the error (actual/expected match).

@LukasKalbertodt
Copy link
Member Author

@CreepySkeleton Oh wow that looks really good! dtolnay did it again! They are just incredible...

Anyway, thanks for mentioning that here! I looked for a good library that does this for quite some time! Will probably try at using it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants