muter
muter copied to clipboard
Muter should look inside the body of forEach
Feel free to update the title if there’s a better way to word this.
Screenshot:

Code:
textViewsAndEncodings.map { $0.key }.forEach {
$0.enabledTextCheckingTypes = 0
$0.isAutomaticQuoteSubstitutionEnabled = false
$0.isAutomaticLinkDetectionEnabled = false
$0.isAutomaticDataDetectionEnabled = false
$0.isAutomaticDashSubstitutionEnabled = false
$0.isAutomaticTextReplacementEnabled = false
$0.isAutomaticSpellingCorrectionEnabled = false
$0.isAutomaticTextCompletionEnabled = false
}
In this code example, Muter correctly identifies that removing the whole forEach call, including its entire body, fails to trigger, but it doesn’t test each of the internal $0.isFooEnabled = false lines for un-tested side effects.
Great catch. I'm also struggling on how to word this issue, but your example is clear to me. I've labeled it accordingly and will figure out the scheduling for this change.
Also, ugh, I hate the thought of actually writing tests for the code I pasted. Probably gonna be a UI test, but could also just query those properties and make sure they stay disabled.