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

YieldValue mutator does not generate any mutations #1380

Closed
maks-rafalko opened this issue Oct 28, 2020 · 7 comments · Fixed by #1382
Closed

YieldValue mutator does not generate any mutations #1380

maks-rafalko opened this issue Oct 28, 2020 · 7 comments · Fixed by #1382

Comments

@maks-rafalko
Copy link
Member

Question Answer
Infection version 0.19.0, master
Test Framework version PHPUnit
PHP version 7.4
Platform -

See https://infection-php.dev/r/4r6

Introduced in #1342

@sanmai
Copy link
Member

sanmai commented Oct 28, 2020

There's something wrong with the playground:

[mutators] The property YieldValue is not defined and the definition does not allow additional properties

@maks-rafalko
Copy link
Member Author

it's in progress, I've updated JSON schema locally, but it still does not work when I add it explicitly

{
    "mutators": {
        "@default": true,
        "YieldValue": true
    }
}

@sanmai
Copy link
Member

sanmai commented Oct 28, 2020

$ php vendor/bin/infection --version
Infection - PHP Mutation Testing Framework version 0.19.0@e28e9ed25217dd8a9f5ffb480347ba96e3a39d3f

$ grep -A2 mutators infection.json.dist
    "mutators": {
        "YieldValue": true
    },

And then:

$ php vendor/bin/infection -j2

Processing source code files: 4/4
.: killed, M: escaped, U: uncovered, E: fatal error, T: timed out, S: skipped

..                                                   (2 / 2)

2 mutations were generated:
       2 mutants were killed

It does generate mutants as far as I can see, not for the very this example though.

@maks-rafalko
Copy link
Member Author

I took this example from tests :)

$a = function () {
    (yield $a => $b);
};

so this is still an issue

@sanmai
Copy link
Member

sanmai commented Oct 28, 2020

Well, I can't reproduce it no matter how I try :(

@sanmai

This comment has been minimized.

@maks-rafalko
Copy link
Member Author

maks-rafalko commented Oct 28, 2020

Reason of the bug: two different mutators mutated the same Node. Nodes must be immutable

Thanks @sanmai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants