Skip to content

Commit

Permalink
Remove unconditional mutation to super()
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
mbj committed Jun 9, 2024
1 parent 830b41c commit 5f33eb9
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 25 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 0 additions & 1 deletion lib/mutant/mutator/node/super.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

module Mutant
# Current mutant version
VERSION = '0.12.1'
VERSION = '0.12.2'
end # Mutant
1 change: 0 additions & 1 deletion meta/super.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
source 'super(foo, bar)'

singleton_mutations
mutation 'super()'
mutation 'super(foo)'
mutation 'super(bar)'
mutation 'super(foo, nil)'
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.minitest.lock
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.10.lock
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.11.lock
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.12.lock
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.13.lock
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.8.lock
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions test_app/Gemfile.rspec3.9.lock
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 5f33eb9

Please sign in to comment.