mutant 0.5.21 → 0.5.22

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
  SHA1:
3
- metadata.gz: bb04983424f2bdda11781922b9b9a90d8463fed9
4
- data.tar.gz: f5cef219a943e5fbd397eda833de9417bcd22c98
3
+ metadata.gz: 12466470fce5fafd680059de82205c093d93c503
4
+ data.tar.gz: c374d20379cb9c81068ce205a6d43d7ddd3505ed
5
5
  SHA512:
6
- metadata.gz: 10a6082273ed23f530a06a28e19cf2aa8d00840b0844753e4bc797605145110d831a2e0b29516b5f0c1b1372ac2a9163ea67f7a7340fc7b13ba955e0dc6ca775
7
- data.tar.gz: 3b5acb587ca255095568ac721b8fe733c8e35a1b54d723070a0d92d247bfcc7e3d08a52be4de0bc7925af25233e6e5b2bae7c557c6837dfb9fa373487056b0b9
6
+ metadata.gz: 3cf3581a8648769d72db4a2cee7522ebece339eef403af542c989cbac811cc3deb34fe03f25795ad80d3a9c5fa12fedc796dda3bc59565b282c1afba311302a3
7
+ data.tar.gz: 61deff160b2dca8288d53a615c8c4ff5a5005612d47383d6f1d1145d6b28eb1eae898d3634e6c16eb02b837b8549fe86834a96c8a015da98a1eaeaf91845a580
@@ -1,3 +1,7 @@
1
+ # v0.5.22 2014-06-15
2
+
3
+ * Fix invalid AST generation on operator method mutation with self as receiver.
4
+
1
5
  # v0.5.21 2014-06-15
2
6
 
3
7
  * Readd mutation of index assignments
@@ -180,17 +180,7 @@ module Mutant
180
180
  @strategy = Strategy::Null.new
181
181
  @cache = Mutant::Cache.new
182
182
  parse(arguments)
183
- config # trigger lazyness now
184
- end
185
-
186
- # Return config
187
- #
188
- # @return [Config]
189
- #
190
- # @api private
191
- #
192
- def config
193
- Config.new(
183
+ @config = Config.new(
194
184
  cache: @cache,
195
185
  zombie: @zombie,
196
186
  debug: @debug,
@@ -201,7 +191,14 @@ module Mutant
201
191
  expected_coverage: @expected_coverage
202
192
  )
203
193
  end
204
- memoize :config
194
+
195
+ # Return config
196
+ #
197
+ # @return [Config]
198
+ #
199
+ # @api private
200
+ #
201
+ attr_reader :config
205
202
 
206
203
  private
207
204
 
@@ -6,9 +6,8 @@ module Mutant
6
6
  include Equalizer.new(:identification)
7
7
 
8
8
  # Methods within rbx kernel directory are precompiled and their source
9
- # cannot be accessed via reading source location
10
- SKIP_METHODS = %w[kernel/ (eval)].freeze
11
- BLACKLIST = /\A#{Regexp.union(*SKIP_METHODS)}/.freeze
9
+ # cannot be accessed via reading source location. Same for methods created by eval.
10
+ BLACKLIST = %r{\Akernel/|(eval)}.freeze
12
11
 
13
12
  # Enumerate matches
14
13
  #
@@ -32,13 +31,9 @@ module Mutant
32
31
 
33
32
  private
34
33
 
35
- # Test if method is skipped
34
+ # Test if method should be skipped
36
35
  #
37
- # @return [true]
38
- # true and print warning if location must be filtered
39
- #
40
- # @return [false]
41
- # otherwise
36
+ # @return [Boolean]
42
37
  #
43
38
  # @api private
44
39
  #
@@ -42,11 +42,7 @@ module Mutant
42
42
  #
43
43
  # @param [Parser::AST::Node] node
44
44
  #
45
- # @return [true]
46
- # if node matches method
47
- #
48
- # @return [false]
49
- # otherwise
45
+ # @return [Boolean]
50
46
  #
51
47
  # @api private
52
48
  #
@@ -26,11 +26,7 @@ module Mutant
26
26
  #
27
27
  # @param [Parser::AST::Node] node
28
28
  #
29
- # @return [true]
30
- # if node matches method
31
- #
32
- # @return [false]
33
- # otherwise
29
+ # @return [Boolean]
34
30
  #
35
31
  # @api private
36
32
  #
@@ -42,11 +38,7 @@ module Mutant
42
38
  #
43
39
  # @param [Parser::AST::Node] node
44
40
  #
45
- # @return [true]
46
- # if node matches source line
47
- #
48
- # @return [false]
49
- # otherwise
41
+ # @return [Boolean]
50
42
  #
51
43
  # @api private
52
44
  #
@@ -60,11 +52,7 @@ module Mutant
60
52
  #
61
53
  # @param [Parser::AST::Node] node
62
54
  #
63
- # @return [true]
64
- # if node name matches
65
- #
66
- # @return [false]
67
- # otherwise
55
+ # @return [Boolean]
68
56
  #
69
57
  # @api private
70
58
  #
@@ -76,11 +64,7 @@ module Mutant
76
64
  #
77
65
  # @param [Parser::AST::Node] node
78
66
  #
79
- # @return [true]
80
- # when receiver matches
81
- #
82
- # @return [false]
83
- # otherwise
67
+ # @return [Boolean]
84
68
  #
85
69
  # @api private
86
70
  #
@@ -105,11 +89,7 @@ module Mutant
105
89
  #
106
90
  # @param [Parser::AST::Node] node
107
91
  #
108
- # @return [true]
109
- # if node name matches unqualified scope name
110
- #
111
- # @return [false]
112
- # otherwise
92
+ # @return [Boolean]
113
93
  #
114
94
  # @api private
115
95
  #
@@ -22,11 +22,7 @@ module Mutant
22
22
  #
23
23
  # @param [Killer] killer
24
24
  #
25
- # @return [true]
26
- # if killer is successful
27
- #
28
- # @return [false]
29
- # otherwise
25
+ # @return [Boolean]
30
26
  #
31
27
  # @api private
32
28
  #
@@ -10,11 +10,7 @@ module Mutant
10
10
  #
11
11
  # @param [Killer] killer
12
12
  #
13
- # @return [true]
14
- # if killer killed mutation
15
- #
16
- # @return [false]
17
- # otherwise
13
+ # @return [Boolean]
18
14
  #
19
15
  # @api private
20
16
  #
@@ -73,10 +73,7 @@ module Mutant
73
73
  #
74
74
  # @param [Object] object
75
75
  #
76
- # @return [true]
77
- # if generated object is different
78
- #
79
- # @return [false]
76
+ # @return [Boolean]
80
77
  #
81
78
  # @api private
82
79
  #
@@ -37,11 +37,7 @@ module Mutant
37
37
 
38
38
  # Test if argument mutation is skipped
39
39
  #
40
- # @return [true]
41
- # if argument should not get mutated
42
- #
43
- # @return [false]
44
- # otherwise
40
+ # @return [Boolean]
45
41
  #
46
42
  # @api private
47
43
  #
@@ -170,8 +170,9 @@ module Mutant
170
170
  #
171
171
  def emit_implicit_self
172
172
  emit_receiver(nil) if n_self?(receiver) && !(
173
- KEYWORDS.include?(selector) ||
174
- OP_ASSIGN.include?(parent_type) ||
173
+ KEYWORDS.include?(selector) ||
174
+ METHOD_OPERATORS.include?(selector) ||
175
+ OP_ASSIGN.include?(parent_type) ||
175
176
  attribute_assignment?
176
177
  )
177
178
  end
@@ -30,11 +30,7 @@ module Mutant
30
30
  #
31
31
  # @param [Object] generated
32
32
  #
33
- # @return [true]
34
- # if object is new
35
- #
36
- # @return [false]
37
- # otherwise
33
+ # @return [Boolean]
38
34
  #
39
35
  # @api private
40
36
  #
@@ -83,11 +83,7 @@ module Mutant
83
83
 
84
84
  # Test if runner was successful
85
85
  #
86
- # @return [true]
87
- # if runner is successful
88
- #
89
- # @return [false]
90
- # otherwise
86
+ # @return [Boolean]
91
87
  #
92
88
  # @api private
93
89
  #
@@ -95,13 +91,9 @@ module Mutant
95
91
  object.success?
96
92
  end
97
93
 
98
- # Test for colored output
99
- #
100
- # @return [true]
101
- # if output is colored
94
+ # Test if output can be colored
102
95
  #
103
- # @return [false]
104
- # otherwise
96
+ # @return [Boolean]
105
97
  #
106
98
  # @api private
107
99
  #
@@ -127,11 +119,7 @@ module Mutant
127
119
 
128
120
  # Test for output to tty
129
121
  #
130
- # @return [true]
131
- # if output is a tty
132
- #
133
- # @return [false]
134
- # otherwise
122
+ # @return [Boolean]
135
123
  #
136
124
  # @api private
137
125
  #
@@ -20,9 +20,9 @@ module Mutant
20
20
  def run
21
21
  if running?
22
22
  info 'Mutant configuration:'
23
- info 'Matcher: %s', config.matcher.inspect
24
- info 'Strategy: %s', config.strategy.inspect
25
- info 'Expect Coverage: %02f%%', config.expected_coverage.inspect
23
+ info 'Matcher: %s', config.matcher.inspect
24
+ info 'Strategy: %s', config.strategy.inspect
25
+ info 'Expect Coverage: %0.2f%%', config.expected_coverage.inspect
26
26
  end
27
27
  self
28
28
  end
@@ -91,11 +91,7 @@ module Mutant
91
91
 
92
92
  # Test if runner should stop
93
93
  #
94
- # @return [true]
95
- # if runner should stop
96
- #
97
- # @return [false]
98
- # otherwise
94
+ # @return [Boolean]
99
95
  #
100
96
  # @api private
101
97
  #
@@ -115,11 +111,7 @@ module Mutant
115
111
 
116
112
  # Test if runner is successful
117
113
  #
118
- # @return [true]
119
- # if successful
120
- #
121
- # @return [false]
122
- # otherwise
114
+ # @return [Boolean]
123
115
  #
124
116
  # @api private
125
117
  #
@@ -43,11 +43,7 @@ module Mutant
43
43
 
44
44
  # Test if run was successful
45
45
  #
46
- # @return [true]
47
- # if run was successful
48
- #
49
- # @return [false]
50
- # otherwise
46
+ # @return [Boolean]
51
47
  #
52
48
  # @api private
53
49
  #
@@ -40,11 +40,7 @@ module Mutant
40
40
 
41
41
  # Test if mutation was handeled successfully
42
42
  #
43
- # @return [true]
44
- # if successful
45
- #
46
- # @return [false]
47
- # otherwise
43
+ # @return [Boolean]
48
44
  #
49
45
  # @api private
50
46
  #
@@ -49,11 +49,7 @@ module Mutant
49
49
 
50
50
  # Test if subject was processed successful
51
51
  #
52
- # @return [true]
53
- # if successful
54
- #
55
- # @return [false]
56
- # otherwise
52
+ # @return [Boolean]
57
53
  #
58
54
  # @api private
59
55
  #
@@ -5,11 +5,7 @@ module Mutant
5
5
 
6
6
  # Test if method is public
7
7
  #
8
- # @return [true]
9
- # if method is public
10
- #
11
- # @return [false]
12
- # otherwise
8
+ # @return [Boolean]
13
9
  #
14
10
  # @api private
15
11
  #
@@ -9,11 +9,7 @@ module Mutant
9
9
 
10
10
  # Test if method is public
11
11
  #
12
- # @return [true]
13
- # if method is public
14
- #
15
- # @return [false]
16
- # otherwise
12
+ # @return [Boolean]
17
13
  #
18
14
  # @api private
19
15
  #
@@ -9,11 +9,7 @@ module Mutant
9
9
 
10
10
  # Test if method is public
11
11
  #
12
- # @return [true]
13
- # if method is public
14
- #
15
- # @return [false]
16
- # otherwise
12
+ # @return [Boolean]
17
13
  #
18
14
  # @api private
19
15
  #
@@ -1,4 +1,4 @@
1
1
  module Mutant
2
2
  # The current mutant version
3
- VERSION = '0.5.21'.freeze
3
+ VERSION = '0.5.22'.freeze
4
4
  end # Mutant
@@ -235,6 +235,16 @@ Mutant::Meta::Example.add do
235
235
  mutation 'foo[]'
236
236
  end
237
237
 
238
+ Mutant::Meta::Example.add do
239
+ source 'self[foo]'
240
+
241
+ singleton_mutations
242
+ mutation 'self[self]'
243
+ mutation 'self[nil]'
244
+ mutation 'self[]'
245
+ mutation 'foo'
246
+ end
247
+
238
248
  Mutant::Meta::Example.add do
239
249
  source 'foo[*bar]'
240
250
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.21
4
+ version: 0.5.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp