Some statements break Stryker.NET
See original GitHub issueThe issue
The following statement breaks Stryker:
string someQuery = "test";
new Uri(new Uri(""), "/API?" + someQuery);
The reason is that changing the +
to an -
will not cause one but two compile errors.
cannot convert from 'System.Uri' to 'string'
Operator '-' cannot be applied to operands of type 'string' and 'string'
During the rollback stage Stryker will try to rollback both errors. It will find the mutation that causes this twice and will try to remove that node twice. The first time is succesful, the second time the node is already removed and will throw a null reference exception. This crashes Stryker.
Fix
https://github.com/stryker-mutator/stryker-net/blob/f5395ae6bdeb38b4aadc84dbaac9caee23a4e699/src/Stryker.Core/Stryker.Core/Compiling/RollbackProcess.cs#L91
The mutation made in the causing statement exists twice in the brokenMutations
Collection. Somehow we have to make sure the list cannot contain a mutation twice.
This will fix the bug.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
I am working on this
Can I do this?