-
Notifications
You must be signed in to change notification settings - Fork 37
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
Leave annotated item outside test module #77
Comments
Hmm, this seems like a valid use case of the crate and no, I don't recall any talks about this feature. I can say that placing fn within created module is a leftover from very early version of this lib and I can't even recall if reasoning is still valid. I'd have to just try moving function upwards. I also just checked that As for flag/separate macro - we're closing in on 2.0, so breaking changes are allowed and it shouldn't break anything too hard. One case would be if users would write something like:
since it's not clashing on 1.0, but would on 2.0. Sooo... can't promise it ships with next major release, but I really like this and I'm gonna try to drop it in. |
Awesome! Much love ❤️ |
I'm not sure if I'm the only one asking for this, but this feels like a no brainer, so it's kind of curious...
I want to use
#[test_case]
annotations on functions that are not test functions but the actual functions that implement things. They might be a part of the public API, or just used by many other functions in the same file. This would be similar to writing a "doc test", but a doc test is necessarily 3 lines and quite verbose compared to just a test_case annotation. Additionally, doc tests are not part of the normal unit test frameworks, but instead handled with a special binary, which causes all sorts of annoyance.Currently, just adding the annotation causes there to be a module added with the function name, and the function to be moved inside that module, and then followed by all the generated test case functions. Instead, I would want the module to be named
test_<ident>
, the generated test cases placed inside that and the function to be left exactly as is. To be honest, that's how I assumed this to work.This would probably need to be a flag, or a separate macro, since I guess all the current users assume that the test case function is purely for testing.
The text was updated successfully, but these errors were encountered: