mutant 0.9.5 → 0.9.10

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