mutant 0.9.4 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +121 -0
  3. data/Changelog.md +26 -0
  4. data/Gemfile +0 -15
  5. data/Gemfile.lock +47 -58
  6. data/Gemfile.shared +7 -0
  7. data/LICENSE +1 -1
  8. data/README.md +72 -23
  9. data/config/reek.yml +1 -0
  10. data/config/rubocop.yml +10 -3
  11. data/docs/commercial-support.md +14 -0
  12. data/lib/mutant.rb +5 -1
  13. data/lib/mutant/ast.rb +0 -9
  14. data/lib/mutant/ast/find_metaclass_containing.rb +48 -0
  15. data/lib/mutant/ast/meta/send.rb +0 -6
  16. data/lib/mutant/bootstrap.rb +0 -36
  17. data/lib/mutant/cli.rb +6 -50
  18. data/lib/mutant/color.rb +0 -3
  19. data/lib/mutant/config.rb +0 -8
  20. data/lib/mutant/context.rb +0 -3
  21. data/lib/mutant/diff.rb +0 -17
  22. data/lib/mutant/env.rb +0 -6
  23. data/lib/mutant/expression/method.rb +6 -6
  24. data/lib/mutant/expression/methods.rb +6 -6
  25. data/lib/mutant/expression/parser.rb +0 -6
  26. data/lib/mutant/integration.rb +0 -18
  27. data/lib/mutant/isolation/fork.rb +0 -22
  28. data/lib/mutant/license.rb +12 -1
  29. data/lib/mutant/matcher.rb +0 -14
  30. data/lib/mutant/matcher/config.rb +0 -11
  31. data/lib/mutant/matcher/method.rb +0 -31
  32. data/lib/mutant/matcher/method/instance.rb +0 -8
  33. data/lib/mutant/matcher/method/metaclass.rb +86 -0
  34. data/lib/mutant/matcher/method/singleton.rb +0 -25
  35. data/lib/mutant/matcher/methods.rb +17 -28
  36. data/lib/mutant/matcher/namespace.rb +0 -10
  37. data/lib/mutant/matcher/scope.rb +2 -4
  38. data/lib/mutant/meta.rb +1 -3
  39. data/lib/mutant/meta/example/dsl.rb +0 -21
  40. data/lib/mutant/meta/example/verification.rb +1 -21
  41. data/lib/mutant/mutation.rb +0 -3
  42. data/lib/mutant/mutator.rb +1 -29
  43. data/lib/mutant/mutator/node.rb +1 -66
  44. data/lib/mutant/mutator/node/and_asgn.rb +0 -3
  45. data/lib/mutant/mutator/node/argument.rb +0 -15
  46. data/lib/mutant/mutator/node/arguments.rb +0 -20
  47. data/lib/mutant/mutator/node/begin.rb +0 -3
  48. data/lib/mutant/mutator/node/binary.rb +0 -23
  49. data/lib/mutant/mutator/node/block.rb +0 -15
  50. data/lib/mutant/mutator/node/break.rb +0 -3
  51. data/lib/mutant/mutator/node/case.rb +0 -9
  52. data/lib/mutant/mutator/node/class.rb +0 -3
  53. data/lib/mutant/mutator/node/conditional_loop.rb +0 -3
  54. data/lib/mutant/mutator/node/const.rb +0 -3
  55. data/lib/mutant/mutator/node/define.rb +0 -11
  56. data/lib/mutant/mutator/node/defined.rb +0 -3
  57. data/lib/mutant/mutator/node/dstr.rb +0 -3
  58. data/lib/mutant/mutator/node/dsym.rb +0 -3
  59. data/lib/mutant/mutator/node/generic.rb +0 -51
  60. data/lib/mutant/mutator/node/if.rb +0 -12
  61. data/lib/mutant/mutator/node/index.rb +0 -27
  62. data/lib/mutant/mutator/node/kwbegin.rb +0 -3
  63. data/lib/mutant/mutator/node/literal.rb +0 -3
  64. data/lib/mutant/mutator/node/literal/array.rb +0 -6
  65. data/lib/mutant/mutator/node/literal/boolean.rb +0 -4
  66. data/lib/mutant/mutator/node/literal/float.rb +0 -9
  67. data/lib/mutant/mutator/node/literal/hash.rb +0 -9
  68. data/lib/mutant/mutator/node/literal/integer.rb +0 -9
  69. data/lib/mutant/mutator/node/literal/nil.rb +0 -3
  70. data/lib/mutant/mutator/node/literal/range.rb +0 -6
  71. data/lib/mutant/mutator/node/literal/regex.rb +0 -6
  72. data/lib/mutant/mutator/node/literal/string.rb +0 -3
  73. data/lib/mutant/mutator/node/literal/symbol.rb +0 -3
  74. data/lib/mutant/mutator/node/masgn.rb +0 -3
  75. data/lib/mutant/mutator/node/match_current_line.rb +0 -3
  76. data/lib/mutant/mutator/node/mlhs.rb +0 -3
  77. data/lib/mutant/mutator/node/named_value/access.rb +2 -14
  78. data/lib/mutant/mutator/node/named_value/constant_assignment.rb +0 -9
  79. data/lib/mutant/mutator/node/named_value/variable_assignment.rb +0 -6
  80. data/lib/mutant/mutator/node/next.rb +0 -3
  81. data/lib/mutant/mutator/node/noop.rb +0 -3
  82. data/lib/mutant/mutator/node/nthref.rb +0 -3
  83. data/lib/mutant/mutator/node/op_asgn.rb +0 -3
  84. data/lib/mutant/mutator/node/or_asgn.rb +0 -3
  85. data/lib/mutant/mutator/node/procarg_zero.rb +0 -3
  86. data/lib/mutant/mutator/node/regopt.rb +0 -6
  87. data/lib/mutant/mutator/node/resbody.rb +0 -6
  88. data/lib/mutant/mutator/node/rescue.rb +2 -19
  89. data/lib/mutant/mutator/node/return.rb +0 -3
  90. data/lib/mutant/mutator/node/sclass.rb +20 -0
  91. data/lib/mutant/mutator/node/send.rb +3 -62
  92. data/lib/mutant/mutator/node/send/attribute_assignment.rb +0 -9
  93. data/lib/mutant/mutator/node/send/binary.rb +0 -11
  94. data/lib/mutant/mutator/node/send/conditional.rb +0 -3
  95. data/lib/mutant/mutator/node/splat.rb +0 -3
  96. data/lib/mutant/mutator/node/super.rb +0 -3
  97. data/lib/mutant/mutator/node/when.rb +0 -19
  98. data/lib/mutant/mutator/node/yield.rb +0 -3
  99. data/lib/mutant/mutator/node/zsuper.rb +0 -3
  100. data/lib/mutant/mutator/util/array.rb +0 -6
  101. data/lib/mutant/mutator/util/symbol.rb +0 -3
  102. data/lib/mutant/parallel.rb +0 -13
  103. data/lib/mutant/parallel/driver.rb +0 -10
  104. data/lib/mutant/parallel/worker.rb +0 -22
  105. data/lib/mutant/registry.rb +2 -7
  106. data/lib/mutant/reporter/cli.rb +0 -5
  107. data/lib/mutant/reporter/cli/format.rb +1 -10
  108. data/lib/mutant/reporter/cli/printer.rb +0 -40
  109. data/lib/mutant/reporter/cli/printer/env_progress.rb +0 -15
  110. data/lib/mutant/reporter/cli/printer/isolation_result.rb +0 -18
  111. data/lib/mutant/reporter/cli/printer/mutation_progress_result.rb +0 -5
  112. data/lib/mutant/reporter/cli/printer/mutation_result.rb +0 -21
  113. data/lib/mutant/reporter/cli/printer/status_progressive.rb +0 -8
  114. data/lib/mutant/reporter/cli/printer/subject_progress.rb +0 -9
  115. data/lib/mutant/repository/diff.rb +1 -13
  116. data/lib/mutant/repository/diff/ranges.rb +0 -11
  117. data/lib/mutant/result.rb +0 -3
  118. data/lib/mutant/runner.rb +0 -18
  119. data/lib/mutant/runner/sink.rb +0 -5
  120. data/lib/mutant/subject.rb +0 -8
  121. data/lib/mutant/subject/method.rb +0 -3
  122. data/lib/mutant/subject/method/instance.rb +0 -5
  123. data/lib/mutant/subject/method/metaclass.rb +30 -0
  124. data/lib/mutant/transform.rb +0 -92
  125. data/lib/mutant/version.rb +1 -1
  126. data/lib/mutant/warnings.rb +0 -6
  127. data/lib/mutant/zombifier.rb +4 -34
  128. data/meta/and.rb +0 -2
  129. data/meta/array.rb +0 -3
  130. data/meta/begin.rb +0 -3
  131. data/meta/block.rb +0 -3
  132. data/meta/break.rb +0 -1
  133. data/meta/case.rb +0 -6
  134. data/meta/casgn.rb +0 -3
  135. data/meta/cvasgn.rb +0 -1
  136. data/meta/def.rb +0 -7
  137. data/meta/ensure.rb +0 -1
  138. data/meta/false.rb +0 -1
  139. data/meta/gvasgn.rb +0 -1
  140. data/meta/hash.rb +0 -4
  141. data/meta/if.rb +0 -5
  142. data/meta/ivasgn.rb +0 -1
  143. data/meta/kwbegin.rb +0 -1
  144. data/meta/lvasgn.rb +0 -1
  145. data/meta/match_current_line.rb +0 -1
  146. data/meta/next.rb +0 -1
  147. data/meta/or.rb +0 -2
  148. data/meta/regexp.rb +0 -1
  149. data/meta/rescue.rb +0 -6
  150. data/meta/sclass.rb +12 -0
  151. data/meta/send.rb +0 -4
  152. data/meta/true.rb +0 -1
  153. data/meta/until.rb +0 -1
  154. data/meta/while.rb +0 -2
  155. data/meta/yield.rb +0 -1
  156. data/mutant.gemspec +4 -3
  157. data/mutant.sh +12 -0
  158. data/spec/integrations.yml +3 -1
  159. data/spec/support/corpus.rb +3 -3
  160. data/spec/support/ruby_vm.rb +1 -2
  161. data/spec/support/shared_context.rb +3 -3
  162. data/spec/support/xspec.rb +2 -2
  163. data/spec/unit/mutant/ast/find_metaclass_containing_spec.rb +64 -0
  164. data/spec/unit/mutant/expression/methods_spec.rb +7 -2
  165. data/spec/unit/mutant/license_spec.rb +17 -5
  166. data/spec/unit/mutant/matcher/method/metaclass_spec.rb +108 -0
  167. data/spec/unit/mutant/matcher/methods/metaclass_spec.rb +62 -0
  168. data/spec/unit/mutant/matcher/namespace_spec.rb +3 -1
  169. data/spec/unit/mutant/matcher/scope_spec.rb +11 -1
  170. data/spec/unit/mutant/meta/example_spec.rb +3 -3
  171. data/spec/unit/mutant/mutator/node_spec.rb +1 -6
  172. data/spec/unit/mutant/parallel/driver_spec.rb +4 -4
  173. data/spec/unit/mutant/parallel/worker_spec.rb +5 -5
  174. data/spec/unit/mutant/parallel_spec.rb +7 -7
  175. data/spec/unit/mutant/registry_spec.rb +52 -25
  176. data/spec/unit/mutant/repository/diff/ranges_spec.rb +2 -2
  177. data/spec/unit/mutant/subject/method/metaclass_spec.rb +63 -0
  178. data/test_app/lib/test_app.rb +1 -0
  179. data/test_app/lib/test_app/metaclasses.rb +108 -0
  180. metadata +43 -16
  181. data/.circleci/config.yml +0 -53
  182. data/lib/mutant/variable.rb +0 -282
  183. data/spec/unit/mutant/variable_spec.rb +0 -618
@@ -17,7 +17,9 @@ module Mutant
17
17
 
18
18
  include AST::Sexp
19
19
 
20
+ # rubocop:disable Lint/InheritException
20
21
  LoadError = Class.new(::LoadError)
22
+ # rubocop:enable Lint/InheritException
21
23
 
22
24
  # Initialize object
23
25
  #
@@ -40,32 +42,20 @@ module Mutant
40
42
 
41
43
  private
42
44
 
43
- # Original require method
45
+ attr_reader :original
46
+ private :original
44
47
  #
45
48
  # @return [Method]
46
- attr_reader :original
47
49
 
48
- # Run zombifier
49
- #
50
- # @return [undefined]
51
50
  def call
52
51
  @original = require_highjack.call(method(:require))
53
52
  require(root_require)
54
53
  end
55
54
 
56
- # Test if logical name is subjected to zombification
57
- #
58
- # @param [String]
59
55
  def include?(logical_name)
60
56
  !@zombified.include?(logical_name) && includes =~ logical_name
61
57
  end
62
58
 
63
- # Require file in zombie namespace
64
- #
65
- # @param [#to_s] logical_name
66
- #
67
- # @return [Bool]
68
- # true if successful and false if feature already loaded
69
59
  def require(logical_name)
70
60
  logical_name = logical_name.to_s
71
61
  loaded = original.call(logical_name)
@@ -75,14 +65,6 @@ module Mutant
75
65
  true
76
66
  end
77
67
 
78
- # Find file by logical path
79
- #
80
- # @param [String] logical_name
81
- #
82
- # @return [File]
83
- #
84
- # @raise [LoadError]
85
- # otherwise
86
68
  def find(logical_name)
87
69
  file_name = "#{logical_name}.rb"
88
70
 
@@ -94,13 +76,6 @@ module Mutant
94
76
  fail LoadError, "Cannot find file #{file_name.inspect} in load path"
95
77
  end
96
78
 
97
- # Zombify contents of file
98
- #
99
- # Probably the 2nd valid use of eval ever. (First one is inserting mutants!).
100
- #
101
- # @param [Pathname] source_path
102
- #
103
- # @return [undefined]
104
79
  def zombify(source_path)
105
80
  kernel.eval(
106
81
  Unparser.unparse(namespaced_node(source_path)),
@@ -109,11 +84,6 @@ module Mutant
109
84
  )
110
85
  end
111
86
 
112
- # Namespaced root node
113
- #
114
- # @param [Pathname] source_path
115
- #
116
- # @return [Parser::AST::Node]
117
87
  def namespaced_node(source_path)
118
88
  s(:module, s(:const, nil, namespace), Unparser.parse(source_path.read))
119
89
  end
@@ -7,8 +7,6 @@ Mutant::Meta::Example.add :and do
7
7
  mutation 'true'
8
8
  mutation 'false'
9
9
  mutation 'true or false'
10
- mutation 'true and nil'
11
- mutation 'nil and false'
12
10
  mutation 'false and false'
13
11
  mutation 'true and true'
14
12
  mutation '!true and false'
@@ -6,7 +6,6 @@ Mutant::Meta::Example.add :array do
6
6
  singleton_mutations
7
7
  mutation 'true'
8
8
  mutation '[false]'
9
- mutation '[nil]'
10
9
  mutation '[]'
11
10
  end
12
11
 
@@ -16,9 +15,7 @@ Mutant::Meta::Example.add :array do
16
15
  singleton_mutations
17
16
 
18
17
  # Mutation of each element in array
19
- mutation '[nil, false]'
20
18
  mutation '[false, false]'
21
- mutation '[true, nil]'
22
19
  mutation '[true, true]'
23
20
 
24
21
  # Remove each element of array once
@@ -6,8 +6,6 @@ Mutant::Meta::Example.add :begin do
6
6
  # Mutation of each statement in block
7
7
  mutation 'true; true'
8
8
  mutation 'false; false'
9
- mutation 'nil; false'
10
- mutation 'true; nil'
11
9
 
12
10
  # Delete each statement
13
11
  mutation 'true'
@@ -18,6 +16,5 @@ Mutant::Meta::Example.add :begin do
18
16
 
19
17
  source s(:begin, s(:true))
20
18
  # Mutation of each statement in block
21
- mutation s(:begin, s(:nil))
22
19
  mutation s(:begin, s(:false))
23
20
  end
@@ -108,7 +108,6 @@ Mutant::Meta::Example.add :block do
108
108
 
109
109
  singleton_mutations
110
110
  mutation 'foo { self << false }'
111
- mutation 'foo { self << nil }'
112
111
  mutation 'foo { nil << true }'
113
112
  mutation 'foo { nil }'
114
113
  mutation 'foo { self }'
@@ -134,7 +133,6 @@ Mutant::Meta::Example.add :block do
134
133
  mutation 'foo { break if true }'
135
134
  mutation 'foo { next if !true }'
136
135
  mutation 'foo { next if false }'
137
- mutation 'foo { next if nil }'
138
136
  mutation 'foo { next }'
139
137
  end
140
138
 
@@ -163,7 +161,6 @@ Mutant::Meta::Example.add :block do
163
161
  mutation 'foo { nil if true }'
164
162
  mutation 'foo { break if !true }'
165
163
  mutation 'foo { break if false }'
166
- mutation 'foo { break if nil }'
167
164
  mutation 'foo { break }'
168
165
  end
169
166
 
@@ -5,6 +5,5 @@ Mutant::Meta::Example.add :break do
5
5
 
6
6
  singleton_mutations
7
7
  mutation 'break false'
8
- mutation 'break nil'
9
8
  mutation 'break'
10
9
  end
@@ -23,12 +23,6 @@ Mutant::Meta::Example.add :case do
23
23
  else
24
24
  end
25
25
  RUBY
26
- mutation <<-RUBY
27
- case
28
- when nil
29
- else
30
- end
31
- RUBY
32
26
  end
33
27
 
34
28
  # rubocop:disable Metrics/BlockLength
@@ -5,7 +5,6 @@ Mutant::Meta::Example.add :casgn do
5
5
 
6
6
  mutation 'A__MUTANT__ = true'
7
7
  mutation 'A = false'
8
- mutation 'A = nil'
9
8
  mutation 'remove_const :A'
10
9
  end
11
10
 
@@ -14,7 +13,6 @@ Mutant::Meta::Example.add :casgn do
14
13
 
15
14
  mutation 'self::A__MUTANT__ = true'
16
15
  mutation 'self::A = false'
17
- mutation 'self::A = nil'
18
16
  mutation 'self.remove_const :A'
19
17
  end
20
18
 
@@ -24,5 +22,4 @@ Mutant::Meta::Example.add :casgn do
24
22
  singleton_mutations
25
23
  mutation 'A__MUTANT__ &&= true'
26
24
  mutation 'A &&= false'
27
- mutation 'A &&= nil'
28
25
  end
@@ -6,5 +6,4 @@ Mutant::Meta::Example.add :cvasgn do
6
6
  singleton_mutations
7
7
  mutation '@@a__mutant__ = true'
8
8
  mutation '@@a = false'
9
- mutation '@@a = nil'
10
9
  end
@@ -56,8 +56,6 @@ Mutant::Meta::Example.add :def do
56
56
  # Mutation of each statement in block
57
57
  mutation 'def foo; true; true; end'
58
58
  mutation 'def foo; false; false; end'
59
- mutation 'def foo; true; nil; end'
60
- mutation 'def foo; nil; false; end'
61
59
 
62
60
  # Remove statement in block
63
61
  mutation 'def foo; true; end'
@@ -97,7 +95,6 @@ Mutant::Meta::Example.add :def do
97
95
  mutation 'def foo(a, b = nil); end'
98
96
  mutation 'def foo; true; end'
99
97
  mutation 'def foo(a, b = nil); raise; end'
100
- mutation 'def foo(a, b = nil); nil; end'
101
98
  mutation 'def foo(a, b = nil); false; end'
102
99
  mutation 'def foo(a); true; end'
103
100
  mutation 'def foo(a, b = nil); b = nil; true; end'
@@ -118,7 +115,6 @@ end
118
115
  Mutant::Meta::Example.add :def do
119
116
  source 'def foo(_unused = true); end'
120
117
 
121
- mutation 'def foo(_unused = nil); end'
122
118
  mutation 'def foo(_unused = false); end'
123
119
  mutation 'def foo(_unused = true); raise; end'
124
120
  mutation 'def foo(_unused); end'
@@ -154,7 +150,6 @@ Mutant::Meta::Example.add :def do
154
150
  mutation 'def foo(a); end'
155
151
  mutation 'def foo(); end'
156
152
  mutation 'def foo(a = false); end'
157
- mutation 'def foo(a = nil); end'
158
153
  mutation 'def foo(_a = true); end'
159
154
  mutation 'def foo(a = true); raise; end'
160
155
  mutation 'def foo(a = true); a = true; end'
@@ -167,8 +162,6 @@ Mutant::Meta::Example.add :def do
167
162
  # Body presence mutation
168
163
  mutation 'def self.foo; false; false; end'
169
164
  mutation 'def self.foo; true; true; end'
170
- mutation 'def self.foo; true; nil; end'
171
- mutation 'def self.foo; nil; false; end'
172
165
 
173
166
  # Body presence mutation
174
167
  mutation 'def self.foo; true; end'
@@ -5,5 +5,4 @@ Mutant::Meta::Example.add :ensure do
5
5
 
6
6
  singleton_mutations
7
7
  mutation 'begin; rescue; ensure; false; end'
8
- mutation 'begin; rescue; ensure; nil; end'
9
8
  end
@@ -3,6 +3,5 @@
3
3
  Mutant::Meta::Example.add :false do
4
4
  source 'false'
5
5
 
6
- mutation 'nil'
7
6
  mutation 'true'
8
7
  end
@@ -6,5 +6,4 @@ Mutant::Meta::Example.add :gvasgn do
6
6
  singleton_mutations
7
7
  mutation '$a__mutant__ = true'
8
8
  mutation '$a = false'
9
- mutation '$a = nil'
10
9
  end
@@ -7,13 +7,9 @@ Mutant::Meta::Example.add :hash do
7
7
 
8
8
  # Mutation of each key and value in hash
9
9
  mutation '{ false => true , false => false }'
10
- mutation '{ nil => true , false => false }'
11
10
  mutation '{ true => false , false => false }'
12
- mutation '{ true => nil , false => false }'
13
11
  mutation '{ true => true , true => false }'
14
- mutation '{ true => true , nil => false }'
15
12
  mutation '{ true => true , false => true }'
16
- mutation '{ true => true , false => nil }'
17
13
 
18
14
  # Remove each key once
19
15
  mutation '{ true => true }'
data/meta/if.rb CHANGED
@@ -28,11 +28,9 @@ Mutant::Meta::Example.add :if do
28
28
 
29
29
  # mutation of if body
30
30
  mutation 'if condition; false; else false; end'
31
- mutation 'if condition; nil; else false; end'
32
31
 
33
32
  # mutation of else body
34
33
  mutation 'if condition; true; else true; end'
35
- mutation 'if condition; true; else nil; end'
36
34
  end
37
35
 
38
36
  Mutant::Meta::Example.add :if do
@@ -41,7 +39,6 @@ Mutant::Meta::Example.add :if do
41
39
  singleton_mutations
42
40
  mutation 'if !condition; true; end'
43
41
  mutation 'if condition; false; end'
44
- mutation 'if condition; nil; end'
45
42
  mutation 'if true; true; end'
46
43
  mutation 'if false; true; end'
47
44
  mutation 'if nil; true; end'
@@ -57,7 +54,6 @@ Mutant::Meta::Example.add :if do
57
54
  mutation 'unless true; true; end'
58
55
  mutation 'unless false; true; end'
59
56
  mutation 'unless condition; false; end'
60
- mutation 'unless condition; nil; end'
61
57
  mutation 'if condition; true; end'
62
58
  mutation 'true'
63
59
  end
@@ -68,7 +64,6 @@ Mutant::Meta::Example.add :if do
68
64
  singleton_mutations
69
65
  mutation 'false if /foo/'
70
66
  mutation 'true if //'
71
- mutation 'nil if /foo/'
72
67
  mutation 'true if true'
73
68
  mutation 'true if false'
74
69
  mutation 'true if nil'
@@ -6,7 +6,6 @@ Mutant::Meta::Example.add :ivasgn do
6
6
  singleton_mutations
7
7
  mutation '@a__mutant__ = true'
8
8
  mutation '@a = false'
9
- mutation '@a = nil'
10
9
  end
11
10
 
12
11
  Mutant::Meta::Example.add :ivasgn do
@@ -5,5 +5,4 @@ Mutant::Meta::Example.add :kwbegin do
5
5
 
6
6
  singleton_mutations
7
7
  mutation 'begin; false; end'
8
- mutation 'begin; nil; end'
9
8
  end
@@ -6,7 +6,6 @@ Mutant::Meta::Example.add :lvasgn do
6
6
  singleton_mutations
7
7
  mutation 'a__mutant__ = true'
8
8
  mutation 'a = false'
9
- mutation 'a = nil'
10
9
  end
11
10
 
12
11
  Mutant::Meta::Example.add :array, :lvasgn do
@@ -6,7 +6,6 @@ Mutant::Meta::Example.add :match_current_line do
6
6
  singleton_mutations
7
7
  mutation 'false if /foo/'
8
8
  mutation 'true if //'
9
- mutation 'nil if /foo/'
10
9
  mutation 'true if true'
11
10
  mutation 'true if false'
12
11
  mutation 'true if nil'
@@ -5,7 +5,6 @@ Mutant::Meta::Example.add :next do
5
5
 
6
6
  singleton_mutations
7
7
  mutation 'next false'
8
- mutation 'next nil'
9
8
  mutation 'next'
10
9
  mutation 'break true'
11
10
  end
data/meta/or.rb CHANGED
@@ -6,9 +6,7 @@ Mutant::Meta::Example.add :or do
6
6
  singleton_mutations
7
7
  mutation 'true'
8
8
  mutation 'false'
9
- mutation 'nil or false'
10
9
  mutation 'false or false'
11
- mutation 'true or nil'
12
10
  mutation 'true or true'
13
11
  mutation 'true and false'
14
12
  mutation '!true or false'
@@ -58,7 +58,6 @@ Mutant::Meta::Example.add :regexp do
58
58
 
59
59
  singleton_mutations
60
60
  mutation 'false if /foo/'
61
- mutation 'nil if /foo/'
62
61
  mutation 'true if true'
63
62
  mutation 'true if false'
64
63
  mutation 'true if nil'
@@ -8,7 +8,6 @@ Mutant::Meta::Example.add :rescue do
8
8
  mutation 'begin; rescue self, ExceptionB => error; true; end'
9
9
  mutation 'begin; rescue ExceptionA, self => error; true; end'
10
10
  mutation 'begin; rescue ExceptionA, ExceptionB => error; false; end'
11
- mutation 'begin; rescue ExceptionA, ExceptionB => error; nil; end'
12
11
  mutation 'begin; true; end'
13
12
 
14
13
  end
@@ -19,7 +18,6 @@ Mutant::Meta::Example.add :rescue do
19
18
  singleton_mutations
20
19
  mutation 'begin; rescue SomeException; true; end'
21
20
  mutation 'begin; rescue SomeException => error; false; end'
22
- mutation 'begin; rescue SomeException => error; nil; end'
23
21
  mutation 'begin; rescue self => error; true; end'
24
22
  mutation 'begin; true; end'
25
23
  end
@@ -29,7 +27,6 @@ Mutant::Meta::Example.add :rescue do
29
27
 
30
28
  singleton_mutations
31
29
  mutation 'begin; rescue => error; false; end'
32
- mutation 'begin; rescue => error; nil; end'
33
30
  mutation 'begin; rescue; true; end'
34
31
  mutation 'begin; true; end'
35
32
  end
@@ -39,7 +36,6 @@ Mutant::Meta::Example.add :rescue do
39
36
 
40
37
  singleton_mutations
41
38
  mutation 'begin; rescue; false; end'
42
- mutation 'begin; rescue; nil; end'
43
39
  mutation 'begin; true end'
44
40
  end
45
41
 
@@ -48,7 +44,6 @@ Mutant::Meta::Example.add :rescue do
48
44
 
49
45
  singleton_mutations
50
46
  mutation 'begin; false; end'
51
- mutation 'begin; nil; end'
52
47
  end
53
48
 
54
49
  Mutant::Meta::Example.add :rescue do
@@ -86,5 +81,4 @@ Mutant::Meta::Example.add :rescue do
86
81
 
87
82
  singleton_mutations
88
83
  mutation 'begin; rescue; ensure; false; end'
89
- mutation 'begin; rescue; ensure; nil; end'
90
84
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ Mutant::Meta::Example.add :sclass do
4
+ source 'class << self; bar; end'
5
+
6
+ mutation 'class << self; nil; end'
7
+ mutation 'class << self; self; end'
8
+ end
9
+
10
+ Mutant::Meta::Example.add :sclass do
11
+ source 'class << self; end'
12
+ end
@@ -5,7 +5,6 @@ Mutant::Meta::Example.add :send do
5
5
 
6
6
  singleton_mutations
7
7
  mutation 'a == b'
8
- mutation 'a >= b'
9
8
  mutation 'a.eql?(b)'
10
9
  mutation 'a.equal?(b)'
11
10
  mutation 'nil > b'
@@ -90,7 +89,6 @@ Mutant::Meta::Example.add :send do
90
89
 
91
90
  singleton_mutations
92
91
  mutation 'a == b'
93
- mutation 'a <= b'
94
92
  mutation 'a.eql?(b)'
95
93
  mutation 'a.equal?(b)'
96
94
  mutation 'nil < b'
@@ -488,9 +486,7 @@ end
488
486
  mutation 'true'
489
487
  mutation 'false'
490
488
  mutation "false #{operator} false"
491
- mutation "nil #{operator} false"
492
489
  mutation "true #{operator} true"
493
- mutation "true #{operator} nil"
494
490
  end
495
491
  end
496
492