-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix issue with output_limit affecting analysis instead of just output. #53
Fix issue with output_limit affecting analysis instead of just output. #53
Conversation
let expected_output = "No output format specified."; | ||
assert_eq!(output_str, expected_output); | ||
} | ||
|
||
#[test] | ||
fn test_output_json_format() { | ||
let file_data_list = get_test_data(); | ||
let output_str = generate_output(&file_data_list, "json".to_string(), &0.1_f64); | ||
let output_str = generate_output(&file_data_list, "json".to_string(), &0.1_f64, 100); | ||
|
||
let expected_output = r##"[ | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there actually a test for this behaviour being correct?
It seems to me that the existing tests were not catching this problem so probably a new test is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, covering this bug is challenging at the moment because it occurs in the top-level analyze
fn. Covering this fn will require some fairly heavy refactoring so that we can mock the relevant things such as walking the filesystem to read source code (and later doing the analysis). TBC if we will carry on as-is or add tests
…t-complex-files-and-skips-checking-the-score-entirely
Fix issue with output_limit affecting analysis instead of just output.