-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Upgrade YAML test #239
Comments
Unless I'm not understanding the question/issue, so long as the Yaml parser spits out a valid ...or maybe I'm misunderstanding 😜 |
As I tried to explain the idea of test it macros PR - we can't claim that it work as it assumed. |
We are only testing the validity, not the correctness. Currently, we have no way to tell from tests that parsing YAML will work as intended and not explode on your face. I agree with @kbknapp that the YAML tests shouldn't check what For example: // Note: this is an over-simplified unit test example.
use super::{YamlLoader, App};
#[test]
fn parse_yaml_author() {
let yml = "
name: claptests
author: Kevin K. <kbknapp@gmail.com>";
let app = App::from_yaml(YamlLoader::load_from_str(yml).unwrap());
assert_eq!(Some("Kevin K. <kbknapp@gmail.com>"), app.author);
} |
Both macro and yaml parsers need to have their testing done by checking that they have performed the expected builder functions against the App. @sru 's For the macro case, I manually verified the generated code - it could still do with a test case; as @Vinatorul pointed out for at least regression testing. |
@sru I told about something like this, but I also think that integration test is overkill. Both false-negative and true-positive cases. |
#270 is by design, so that's not really a bug. But yes, we should update the tests to ensure everything is good to go. ;) |
Now yaml test only check
yml
parsing, but not the the work in general.I think we need to add:
The text was updated successfully, but these errors were encountered: