mutant 0.10.33 → 0.10.34

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c20fb3fdc41f7d6e0f8164916206353716c037ec596fccccd06db10c05e810c
4
- data.tar.gz: 276612decdc11bf06de38e704fed0d6dc3b9b0b590d9e2f333be7ae383396ca0
3
+ metadata.gz: ccd2a5c4c1c3ddf3b7eea82c613a144594609387a414cac729b75c4645295f47
4
+ data.tar.gz: e173ad25eb08658a040a7ca7cb6dca36a1d8bc9f01137e63fed081069b3ab9cb
5
5
  SHA512:
6
- metadata.gz: 652ac4959565f27514568c25c43a0ab64d3af74f9f9de50712bf6e6e825dcf44d27e55e40ff76f0e7c91e27c4199c4f67a0d2205f2268eefae5acc338e2aecb5
7
- data.tar.gz: a7e9b023ffefb0d3da5a13d7ec83fbb6696a10efe0f8840b867e8f6e788a55e7d2eabd077173957a697e9f0689ce109fec5d8668078946e317f7c9c4b7216614
6
+ metadata.gz: bdebc9987d92b122b409715cc7933dc86952ae6dc58ed8f9a5525bcbfe8dc0aae93cf773622eced59643d27d4311df1f94f9c41a1abd1adc93e4a6b65771118d
7
+ data.tar.gz: 9e7d2dde25b8e532301475e8b7bc970626db00d36ce0abd5e4082aa2b39599a86372b4de93e5d61470f974f90539cf5445d51e242bcfbfec600ad8a5fca2b5aa
@@ -7,7 +7,7 @@ module Mutant
7
7
  class Run < self
8
8
  NAME = 'run'
9
9
  SHORT_DESCRIPTION = 'Run code analysis'
10
- SLEEP = 40
10
+ SLEEP = 60
11
11
  SUBCOMMANDS = EMPTY_ARRAY
12
12
 
13
13
  UNLICENSED = <<~MESSAGE.lines.freeze
@@ -16,6 +16,20 @@ module Mutant
16
16
  See https://github.com/mbj/mutant#licensing
17
17
  MESSAGE
18
18
 
19
+ NO_TESTS_MESSAGE = <<~'MESSAGE'
20
+ ===============
21
+ Mutant found no tests. Mutation testing cannot be started.
22
+
23
+ This can have various reasons:
24
+
25
+ * You did not setup an integration, see:
26
+ https://github.com/mbj/mutant/blob/main/docs/configuration.md#integration
27
+ * You set environment variables like RSPEC_OPTS that filter out all tests.
28
+ * You set configuration optiosn like `config.filter_run :focus` which do
29
+ make rspec to not report any test.
30
+ ===============
31
+ MESSAGE
32
+
19
33
  # Test if command needs to be executed in zombie environment
20
34
  #
21
35
  # @return [Bool]
@@ -28,10 +42,19 @@ module Mutant
28
42
  def action
29
43
  soft_fail(License.call(world))
30
44
  .bind { bootstrap }
45
+ .bind(&method(:validate_tests))
31
46
  .bind(&Runner.public_method(:call))
32
47
  .bind(&method(:from_result))
33
48
  end
34
49
 
50
+ def validate_tests(environment)
51
+ if environment.integration.all_tests.length.zero?
52
+ Either::Left.new(NO_TESTS_MESSAGE)
53
+ else
54
+ Either::Right.new(environment)
55
+ end
56
+ end
57
+
35
58
  def from_result(result)
36
59
  if result.success?
37
60
  Either::Right.new(nil)
@@ -130,6 +130,8 @@ module Mutant
130
130
  end
131
131
 
132
132
  def add_global_options(parser)
133
+ parser.separator("mutant version: #{VERSION}")
134
+ parser.separator(nil)
133
135
  parser.separator('Global Options:')
134
136
  parser.separator(nil)
135
137
 
@@ -21,8 +21,11 @@ module Mutant
21
21
  emit_singletons
22
22
  emit_promotions
23
23
  emit_operator_mutations
24
- emit_left_negation
25
- emit_left_mutations
24
+
25
+ emit_left_mutations do |mutation|
26
+ !(n_irange?(mutation) || n_erange?(mutation)) || !mutation.children.fetch(1).nil?
27
+ end
28
+
26
29
  emit_right_mutations
27
30
  end
28
31
 
@@ -35,10 +38,6 @@ module Mutant
35
38
  emit(right)
36
39
  end
37
40
 
38
- def emit_left_negation
39
- emit(s(node.type, n_not(left), right))
40
- end
41
-
42
41
  end # Binary
43
42
  end # Node
44
43
  end # Mutator
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mutant
4
+ class Mutator
5
+ class Node
6
+ class Numblock < self
7
+
8
+ handle(:numblock)
9
+
10
+ children :receiver, :count, :block
11
+
12
+ private
13
+
14
+ def dispatch
15
+ emit_nil
16
+ emit_receiver_mutations(&method(:n_send?))
17
+ end
18
+ end # Numblock
19
+ end # Node
20
+ end # Mutator
21
+ end # Mutant
@@ -8,7 +8,7 @@ module Mutant
8
8
  class Mutation < self
9
9
  NO_DIFF_MESSAGE = <<~'MESSAGE'
10
10
  --- Internal failure ---
11
- BUG: A generted mutation did not result in exactly one diff hunk!
11
+ BUG: A generated mutation did not result in exactly one diff hunk!
12
12
  This is an invariant violation by the mutation generation engine.
13
13
  Please report a reproduction to https://github.com/mbj/mutant
14
14
  Original unparsed source:
@@ -27,7 +27,7 @@ module Mutant
27
27
 
28
28
  NO_DIFF_MESSAGE = <<~'MESSAGE'
29
29
  --- Internal failure ---
30
- BUG: A generted mutation did not result in exactly one diff hunk!
30
+ BUG: A generated mutation did not result in exactly one diff hunk!
31
31
  This is an invariant violation by the mutation generation engine.
32
32
  Please report a reproduction to https://github.com/mbj/mutant
33
33
  Original unparsed source:
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # Current mutant version
5
- VERSION = '0.10.33'
5
+ VERSION = '0.10.34'
6
6
  end # Mutant
data/lib/mutant.rb CHANGED
@@ -152,6 +152,7 @@ require 'mutant/mutator/node/match_current_line'
152
152
  require 'mutant/mutator/node/index'
153
153
  require 'mutant/mutator/node/procarg_zero'
154
154
  require 'mutant/mutator/node/kwargs'
155
+ require 'mutant/mutator/node/numblock'
155
156
  require 'mutant/loader'
156
157
  require 'mutant/context'
157
158
  require 'mutant/scope'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.33
4
+ version: 0.10.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-25 00:00:00.000000000 Z
11
+ date: 2021-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs
@@ -269,6 +269,7 @@ files:
269
269
  - lib/mutant/mutator/node/next.rb
270
270
  - lib/mutant/mutator/node/noop.rb
271
271
  - lib/mutant/mutator/node/nthref.rb
272
+ - lib/mutant/mutator/node/numblock.rb
272
273
  - lib/mutant/mutator/node/op_asgn.rb
273
274
  - lib/mutant/mutator/node/or_asgn.rb
274
275
  - lib/mutant/mutator/node/procarg_zero.rb