From 5f33eb9fd3008a8dd13cb7ba823fd278bd51a846 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Sun, 9 Jun 2024 22:35:05 +0000 Subject: [PATCH] Remove unconditional mutation to super() This mutation only makes sense if the method was called with arguments in the first place. If there are no arguments `super()` and `super` are semantically equivalent. And there is no vector towards reduced semantics, which is required for an operator to be valid. If mutant would be able to emit this mutation conditionally (on the presence of arguments) than this is a valid operator. Until than we cannot emit it. [fix #615] --- Changelog.md | 6 ++++++ Gemfile.lock | 2 +- lib/mutant/mutator/node/super.rb | 1 - lib/mutant/version.rb | 2 +- meta/super.rb | 1 - test_app/Gemfile.minitest.lock | 6 +++--- test_app/Gemfile.rspec3.10.lock | 6 +++--- test_app/Gemfile.rspec3.11.lock | 6 +++--- test_app/Gemfile.rspec3.12.lock | 6 +++--- test_app/Gemfile.rspec3.13.lock | 6 +++--- test_app/Gemfile.rspec3.8.lock | 6 +++--- test_app/Gemfile.rspec3.9.lock | 6 +++--- 12 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Changelog.md b/Changelog.md index 80ef46595..0ebfa6637 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,9 @@ +# v0.12.1 2024-06-09 + ++ [#1445](https://github.com/mbj/mutant/pull/1444) + + Remove invalid mutation operator. + # v0.12.1 2024-05-11 * [#1444](https://github.com/mbj/mutant/pull/1444) diff --git a/Gemfile.lock b/Gemfile.lock index 926d8c5c3..1d9afa1ab 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - mutant (0.12.1) + mutant (0.12.2) diff-lcs (~> 1.3) parser (~> 3.3.0) regexp_parser (~> 2.9.0) diff --git a/lib/mutant/mutator/node/super.rb b/lib/mutant/mutator/node/super.rb index e9db4ecd7..7fe04b31c 100644 --- a/lib/mutant/mutator/node/super.rb +++ b/lib/mutant/mutator/node/super.rb @@ -13,7 +13,6 @@ class Super < self def dispatch emit_singletons - emit(N_EMPTY_SUPER) children.each_index do |index| mutate_child(index) delete_child(index) diff --git a/lib/mutant/version.rb b/lib/mutant/version.rb index e63405288..eb8485ae9 100644 --- a/lib/mutant/version.rb +++ b/lib/mutant/version.rb @@ -2,5 +2,5 @@ module Mutant # Current mutant version - VERSION = '0.12.1' + VERSION = '0.12.2' end # Mutant diff --git a/meta/super.rb b/meta/super.rb index e6243f5c6..9092dd574 100644 --- a/meta/super.rb +++ b/meta/super.rb @@ -17,7 +17,6 @@ source 'super(foo, bar)' singleton_mutations - mutation 'super()' mutation 'super(foo)' mutation 'super(bar)' mutation 'super(foo, nil)' diff --git a/test_app/Gemfile.minitest.lock b/test_app/Gemfile.minitest.lock index 211c0696d..9a74e3b47 100644 --- a/test_app/Gemfile.minitest.lock +++ b/test_app/Gemfile.minitest.lock @@ -1,15 +1,15 @@ PATH remote: .. specs: - mutant (0.12.1) + mutant (0.12.2) diff-lcs (~> 1.3) parser (~> 3.3.0) regexp_parser (~> 2.9.0) sorbet-runtime (~> 0.5.0) unparser (~> 0.6.9) - mutant-minitest (0.12.1) + mutant-minitest (0.12.2) minitest (~> 5.11) - mutant (= 0.12.1) + mutant (= 0.12.2) GEM remote: https://rubygems.org/ diff --git a/test_app/Gemfile.rspec3.10.lock b/test_app/Gemfile.rspec3.10.lock index 60f48ebf1..0e6fac8f8 100644 --- a/test_app/Gemfile.rspec3.10.lock +++ b/test_app/Gemfile.rspec3.10.lock @@ -1,14 +1,14 @@ PATH remote: .. specs: - mutant (0.12.1) + mutant (0.12.2) diff-lcs (~> 1.3) parser (~> 3.3.0) regexp_parser (~> 2.9.0) sorbet-runtime (~> 0.5.0) unparser (~> 0.6.9) - mutant-rspec (0.12.1) - mutant (= 0.12.1) + mutant-rspec (0.12.2) + mutant (= 0.12.2) rspec-core (>= 3.8.0, < 4.0.0) GEM diff --git a/test_app/Gemfile.rspec3.11.lock b/test_app/Gemfile.rspec3.11.lock index 8c1836d99..6e5eb384f 100644 --- a/test_app/Gemfile.rspec3.11.lock +++ b/test_app/Gemfile.rspec3.11.lock @@ -1,14 +1,14 @@ PATH remote: .. specs: - mutant (0.12.1) + mutant (0.12.2) diff-lcs (~> 1.3) parser (~> 3.3.0) regexp_parser (~> 2.9.0) sorbet-runtime (~> 0.5.0) unparser (~> 0.6.9) - mutant-rspec (0.12.1) - mutant (= 0.12.1) + mutant-rspec (0.12.2) + mutant (= 0.12.2) rspec-core (>= 3.8.0, < 4.0.0) GEM diff --git a/test_app/Gemfile.rspec3.12.lock b/test_app/Gemfile.rspec3.12.lock index 21fe63f69..c5d15682b 100644 --- a/test_app/Gemfile.rspec3.12.lock +++ b/test_app/Gemfile.rspec3.12.lock @@ -1,14 +1,14 @@ PATH remote: .. specs: - mutant (0.12.1) + mutant (0.12.2) diff-lcs (~> 1.3) parser (~> 3.3.0) regexp_parser (~> 2.9.0) sorbet-runtime (~> 0.5.0) unparser (~> 0.6.9) - mutant-rspec (0.12.1) - mutant (= 0.12.1) + mutant-rspec (0.12.2) + mutant (= 0.12.2) rspec-core (>= 3.8.0, < 4.0.0) GEM diff --git a/test_app/Gemfile.rspec3.13.lock b/test_app/Gemfile.rspec3.13.lock index 91be4b719..bf6c0c60b 100644 --- a/test_app/Gemfile.rspec3.13.lock +++ b/test_app/Gemfile.rspec3.13.lock @@ -1,14 +1,14 @@ PATH remote: .. specs: - mutant (0.12.1) + mutant (0.12.2) diff-lcs (~> 1.3) parser (~> 3.3.0) regexp_parser (~> 2.9.0) sorbet-runtime (~> 0.5.0) unparser (~> 0.6.9) - mutant-rspec (0.12.1) - mutant (= 0.12.1) + mutant-rspec (0.12.2) + mutant (= 0.12.2) rspec-core (>= 3.8.0, < 4.0.0) GEM diff --git a/test_app/Gemfile.rspec3.8.lock b/test_app/Gemfile.rspec3.8.lock index 25b26ea72..00be2e3c2 100644 --- a/test_app/Gemfile.rspec3.8.lock +++ b/test_app/Gemfile.rspec3.8.lock @@ -1,14 +1,14 @@ PATH remote: .. specs: - mutant (0.12.1) + mutant (0.12.2) diff-lcs (~> 1.3) parser (~> 3.3.0) regexp_parser (~> 2.9.0) sorbet-runtime (~> 0.5.0) unparser (~> 0.6.9) - mutant-rspec (0.12.1) - mutant (= 0.12.1) + mutant-rspec (0.12.2) + mutant (= 0.12.2) rspec-core (>= 3.8.0, < 4.0.0) GEM diff --git a/test_app/Gemfile.rspec3.9.lock b/test_app/Gemfile.rspec3.9.lock index 21fe63f69..c5d15682b 100644 --- a/test_app/Gemfile.rspec3.9.lock +++ b/test_app/Gemfile.rspec3.9.lock @@ -1,14 +1,14 @@ PATH remote: .. specs: - mutant (0.12.1) + mutant (0.12.2) diff-lcs (~> 1.3) parser (~> 3.3.0) regexp_parser (~> 2.9.0) sorbet-runtime (~> 0.5.0) unparser (~> 0.6.9) - mutant-rspec (0.12.1) - mutant (= 0.12.1) + mutant-rspec (0.12.2) + mutant (= 0.12.2) rspec-core (>= 3.8.0, < 4.0.0) GEM