Closed JonathanFoo0523 closed 1 month ago
Thanks for this report!
I think it makes more sense to return 0 to indicate that no mutants are present. That's what I have done in #269.
Thanks for this report!
I think it makes more sense to return 0 to indicate that no mutants are present. That's what I have done in #269.
I thought that we start counting mutant id from 0, and that the script returns the largest mutant id instead of number of mutants.
As an example, this should return 0:
int main() {
printf("foo\n");
}
But this shouldn't:
int main() {}
You're right - #271 opened to fix this; I think returning -1 is a reasonable solution.
When dredd is applied to a file where no mutations are possible, querying the mutation-info-file for the largest mutant ID results in an error. The following statement at line 326 in
query_mutant_info.py
:fails with the error message
ValueError: max() arg is an empty sequence
.Can we return something like -1 or just print a message to indicate that no mutants are present?