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

Fix issue with output_limit affecting analysis instead of just output. #53

Conversation

bencollins54
Copy link
Collaborator

Fix issue with output_limit affecting analysis instead of just output.

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##"[
{
Copy link
Owner

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

Copy link
Owner

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

@sgb-io sgb-io mentioned this pull request Oct 20, 2023
@sgb-io sgb-io merged commit c73e04d into main Oct 21, 2023
8 checks passed
@sgb-io sgb-io deleted the 46-fta-cli-limiting-output-does-not-show-most-complex-files-and-skips-checking-the-score-entirely branch October 21, 2023 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fta-cli: limiting output does not show most complex files, and skips checking the score entirely
3 participants