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

Muter should look inside the body of forEach #117

Open
ZevEisenberg opened this issue Jun 16, 2019 · 2 comments
Open

Muter should look inside the body of forEach #117

ZevEisenberg opened this issue Jun 16, 2019 · 2 comments
Labels
dependability Work that's to improve how much a user can depend on muter being accurate and safe with their code mutation operators Work that's intended to improve the mutation operators muter has

Comments

@ZevEisenberg
Copy link
Collaborator

ZevEisenberg commented Jun 16, 2019

Feel free to update the title if there’s a better way to word this.

Screenshot:
image

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.

@SeanROlszewski SeanROlszewski added dependability Work that's to improve how much a user can depend on muter being accurate and safe with their code mutation operators Work that's intended to improve the mutation operators muter has labels Jun 16, 2019
@SeanROlszewski
Copy link
Contributor

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.

@ZevEisenberg
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependability Work that's to improve how much a user can depend on muter being accurate and safe with their code mutation operators Work that's intended to improve the mutation operators muter has
Projects
None yet
Development

No branches or pull requests

2 participants