From 42c0dadb288a619ecd2b5ec2a7bc412d2bd18afb Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Fri, 9 Feb 2024 15:01:36 +0000 Subject: [PATCH 1/2] Upgrade dependencies --- Gemfile.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 64fac9fe8..c3fab8eae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,38 +17,38 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.2) - diff-lcs (1.5.0) + diff-lcs (1.5.1) json (2.7.1) language_server-protocol (3.17.0.3) parallel (1.24.0) - parser (3.3.0.2) + parser (3.3.0.5) ast (~> 2.4.1) racc racc (1.7.3) rainbow (3.1.1) regexp_parser (2.8.3) rexml (3.2.6) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) + rspec-support (~> 3.13.0) rspec-its (1.3.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.12.6) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.1) - rubocop (1.59.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.0) + rubocop (1.60.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.4) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) @@ -58,11 +58,11 @@ GEM rubocop-ast (1.30.0) parser (>= 3.2.1.0) ruby-progressbar (1.13.0) - sorbet-runtime (0.5.11180) + sorbet-runtime (0.5.11238) unicode-display_width (2.5.0) - unparser (0.6.12) + unparser (0.6.13) diff-lcs (~> 1.3) - parser (>= 3.2.2.4) + parser (>= 3.3.0) PLATFORMS ruby From 81c58fc216d699e52b3d527968874f0351b982ff Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Fri, 9 Feb 2024 16:38:47 +0000 Subject: [PATCH 2/2] Fix mutation to invalid hash pattern [fix #1417] --- Changelog.md | 5 ++++- Gemfile.lock | 2 +- lib/mutant/mutator/node/literal/hash.rb | 4 +++- lib/mutant/version.rb | 2 +- meta/case.rb | 14 ++++++++++++++ meta/def.rb | 1 - test_app/Gemfile.minitest.lock | 6 +++--- test_app/Gemfile.rspec3.8.lock | 6 +++--- 8 files changed, 29 insertions(+), 11 deletions(-) diff --git a/Changelog.md b/Changelog.md index 9499a5fff..39e8d5fb9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,7 @@ -# v0.11.28 +# v0.11.28 2024-02-09 + +* [#1418](https://github.com/mbj/mutant/pull/1418) + Fix mutation to invalid pattern match. * [#1416](https://github.com/mbj/mutant/pull/1416) Fix CLI parsing issue where arguments given to `mutant environment` where silently ignored. diff --git a/Gemfile.lock b/Gemfile.lock index c3fab8eae..ae3f43ef4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - mutant (0.11.27) + mutant (0.11.28) diff-lcs (~> 1.3) parser (~> 3.3.0) regexp_parser (~> 2.8.2) diff --git a/lib/mutant/mutator/node/literal/hash.rb b/lib/mutant/mutator/node/literal/hash.rb index 5bdefc219..8dce21773 100644 --- a/lib/mutant/mutator/node/literal/hash.rb +++ b/lib/mutant/mutator/node/literal/hash.rb @@ -36,7 +36,9 @@ class Pair < Node private def dispatch - emit_key_mutations + emit_key_mutations do |mutation| + !mutation.eql?(s(:nil)) + end emit_value_mutations end diff --git a/lib/mutant/version.rb b/lib/mutant/version.rb index 8cce2e534..1671962d5 100644 --- a/lib/mutant/version.rb +++ b/lib/mutant/version.rb @@ -2,5 +2,5 @@ module Mutant # Current mutant version - VERSION = '0.11.27' + VERSION = '0.11.28' end # Mutant diff --git a/meta/case.rb b/meta/case.rb index b8dd0228d..96b677b25 100644 --- a/meta/case.rb +++ b/meta/case.rb @@ -1,5 +1,19 @@ # frozen_string_literal: true +Mutant::Meta::Example.add :case do + source <<-RUBY + case nil + in { a: nil } + end + RUBY + + mutation <<~RUBY + case nil + in {a__mutant__: nil} + end + RUBY +end + Mutant::Meta::Example.add :case do source <<-RUBY case diff --git a/meta/def.rb b/meta/def.rb index 44cde4776..01c3ae9c5 100644 --- a/meta/def.rb +++ b/meta/def.rb @@ -226,7 +226,6 @@ mutation 'def foo(**); { ** }; end' mutation 'def foo(**); { default: nil }; end' mutation 'def foo(**); { default__mutant__: nil, ** }; end' - mutation 'def foo(**); { nil => nil, ** }; end' mutation 'def foo(**); {}; end' end diff --git a/test_app/Gemfile.minitest.lock b/test_app/Gemfile.minitest.lock index 7d6ddf8dd..4f5f4e629 100644 --- a/test_app/Gemfile.minitest.lock +++ b/test_app/Gemfile.minitest.lock @@ -1,15 +1,15 @@ PATH remote: .. specs: - mutant (0.11.27) + mutant (0.11.28) diff-lcs (~> 1.3) parser (~> 3.3.0) regexp_parser (~> 2.8.2) sorbet-runtime (~> 0.5.0) unparser (~> 0.6.9) - mutant-minitest (0.11.27) + mutant-minitest (0.11.28) minitest (~> 5.11) - mutant (= 0.11.27) + mutant (= 0.11.28) GEM remote: https://oss:Px2ENN7S91OmWaD5G7MIQJi1dmtmYrEh@gem.mutant.dev/ diff --git a/test_app/Gemfile.rspec3.8.lock b/test_app/Gemfile.rspec3.8.lock index c6cfcc017..a2bad631d 100644 --- a/test_app/Gemfile.rspec3.8.lock +++ b/test_app/Gemfile.rspec3.8.lock @@ -1,14 +1,14 @@ PATH remote: .. specs: - mutant (0.11.27) + mutant (0.11.28) diff-lcs (~> 1.3) parser (~> 3.3.0) regexp_parser (~> 2.8.2) sorbet-runtime (~> 0.5.0) unparser (~> 0.6.9) - mutant-rspec (0.11.27) - mutant (= 0.11.27) + mutant-rspec (0.11.28) + mutant (= 0.11.28) rspec-core (>= 3.8.0, < 4.0.0) GEM