mutant 0.3.0.beta11 → 0.3.0.beta12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/TODO +1 -0
- data/config/flay.yml +1 -1
- data/lib/mutant.rb +1 -0
- data/lib/mutant/matcher/method/instance.rb +1 -0
- data/lib/mutant/mutator/node/generic.rb +1 -1
- data/lib/mutant/mutator/node/masgn.rb +27 -0
- data/lib/mutant/reporter/cli/printer/subject.rb +1 -0
- data/lib/mutant/strategy/rspec/dm2/lookup/method.rb +1 -0
- data/lib/mutant/subject/method/instance.rb +11 -0
- data/mutant.gemspec +1 -1
- data/spec/unit/mutant/mutator/node/masgn/mutation_spec.rb +17 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da90ad9db025d0f924a9a2ec2caa5f01e387f9f0
|
4
|
+
data.tar.gz: e207396b46243ec605b51217da7547c9cada8cc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3af704eb2e700422af4fbada84859fbbaf34562f1e5a03d97483c9f81364fb331467e800f6b096e21bb85e6fe4a1766341deee1f9d403736bf348198542e027
|
7
|
+
data.tar.gz: f72e8962725f13ee7eda39df07f2e8fb7c6efc0c22683112361cd0971c958d3fe6e41ba1f4acac3bebf465e0bff08201d2d539e536569c0c2f043e1ff20da1d5
|
data/TODO
CHANGED
@@ -4,6 +4,7 @@ Code:
|
|
4
4
|
* Log all warnings through reporter, so remove random $stderr.puts calls
|
5
5
|
|
6
6
|
Mutations:
|
7
|
+
* Add true masgn mutations
|
7
8
|
* Add binary operator specific mutations (YAY, finally reached this point)
|
8
9
|
* Add some kind of a "do not touch me object" that raises on all messages.
|
9
10
|
It can be used to make sure each literal value is touched.
|
data/config/flay.yml
CHANGED
data/lib/mutant.rb
CHANGED
@@ -64,6 +64,7 @@ require 'mutant/mutator/node/when'
|
|
64
64
|
require 'mutant/mutator/node/assignment'
|
65
65
|
require 'mutant/mutator/node/define'
|
66
66
|
require 'mutant/mutator/node/mlhs'
|
67
|
+
require 'mutant/mutator/node/masgn'
|
67
68
|
require 'mutant/mutator/node/return'
|
68
69
|
require 'mutant/mutator/node/block'
|
69
70
|
require 'mutant/mutator/node/if'
|
@@ -12,7 +12,7 @@ module Mutant
|
|
12
12
|
:next, :break, :match, :gvar, :cvar, :ensure,
|
13
13
|
:dstr, :dsym, :yield, :rescue, :redo, :defined?,
|
14
14
|
:lvar, :splat, :const, :blockarg, :block_pass, :op_asgn, :regopt,
|
15
|
-
:ivar, :restarg, :casgn, :
|
15
|
+
:ivar, :restarg, :casgn, :resbody, :retry, :arg_expr,
|
16
16
|
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :cbase, :empty,
|
17
17
|
:alias, :for, :xstr, :back_ref, :nth_ref, :class, :sclass, :match_with_lvasgn,
|
18
18
|
:match_current_line, :or_asgn, :kwbegin
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Mutant
|
2
|
+
class Mutator
|
3
|
+
class Node
|
4
|
+
|
5
|
+
# Mutation emitter to handle multipl assignment nodes
|
6
|
+
class MultipleAssignment < self
|
7
|
+
|
8
|
+
handle(:masgn)
|
9
|
+
|
10
|
+
children :left, :right
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
# Perform dispatch
|
15
|
+
#
|
16
|
+
# @return [undefined]
|
17
|
+
#
|
18
|
+
# @api private
|
19
|
+
#
|
20
|
+
def dispatch
|
21
|
+
# noop, for now
|
22
|
+
end
|
23
|
+
|
24
|
+
end # MultipleAssignment
|
25
|
+
end # Node
|
26
|
+
end # Mutator
|
27
|
+
end # Mutant
|
@@ -26,6 +26,7 @@ module Mutant
|
|
26
26
|
|
27
27
|
# Mutator for memoized instance methods
|
28
28
|
class Memoized < self
|
29
|
+
include NodeHelpers
|
29
30
|
|
30
31
|
private
|
31
32
|
|
@@ -41,6 +42,16 @@ module Mutant
|
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
45
|
+
# Return neutral mutation
|
46
|
+
#
|
47
|
+
# @return [Mutation::Neutral]
|
48
|
+
#
|
49
|
+
# @api private
|
50
|
+
#
|
51
|
+
def noop_mutation
|
52
|
+
Mutation::Neutral::Noop.new(self, memoizer_node(node))
|
53
|
+
end
|
54
|
+
|
44
55
|
# Return memoizer node for mutant
|
45
56
|
#
|
46
57
|
# @param [Parser::AST::Node] mutant
|
data/mutant.gemspec
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Mutant::Mutator, 'masgn' do
|
4
|
+
|
5
|
+
before do
|
6
|
+
Mutant::Random.stub(:hex_string => 'random')
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
let(:source) { 'a, b = c, d' }
|
11
|
+
|
12
|
+
let(:mutations) do
|
13
|
+
mutants = []
|
14
|
+
end
|
15
|
+
|
16
|
+
it_should_behave_like 'a mutator'
|
17
|
+
end
|
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.3.0.
|
4
|
+
version: 0.3.0.beta12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
@@ -238,6 +238,7 @@ files:
|
|
238
238
|
- lib/mutant/mutator/node/literal/regex.rb
|
239
239
|
- lib/mutant/mutator/node/literal/string.rb
|
240
240
|
- lib/mutant/mutator/node/literal/symbol.rb
|
241
|
+
- lib/mutant/mutator/node/masgn.rb
|
241
242
|
- lib/mutant/mutator/node/mlhs.rb
|
242
243
|
- lib/mutant/mutator/node/return.rb
|
243
244
|
- lib/mutant/mutator/node/send.rb
|
@@ -331,6 +332,7 @@ files:
|
|
331
332
|
- spec/unit/mutant/mutator/node/literal/regex_spec.rb
|
332
333
|
- spec/unit/mutant/mutator/node/literal/string_spec.rb
|
333
334
|
- spec/unit/mutant/mutator/node/literal/symbol_spec.rb
|
335
|
+
- spec/unit/mutant/mutator/node/masgn/mutation_spec.rb
|
334
336
|
- spec/unit/mutant/mutator/node/return/mutation_spec.rb
|
335
337
|
- spec/unit/mutant/mutator/node/send/mutation_spec.rb
|
336
338
|
- spec/unit/mutant/mutator/node/super/mutation_spec.rb
|
@@ -438,6 +440,7 @@ test_files:
|
|
438
440
|
- spec/unit/mutant/mutator/node/literal/regex_spec.rb
|
439
441
|
- spec/unit/mutant/mutator/node/literal/string_spec.rb
|
440
442
|
- spec/unit/mutant/mutator/node/literal/symbol_spec.rb
|
443
|
+
- spec/unit/mutant/mutator/node/masgn/mutation_spec.rb
|
441
444
|
- spec/unit/mutant/mutator/node/return/mutation_spec.rb
|
442
445
|
- spec/unit/mutant/mutator/node/send/mutation_spec.rb
|
443
446
|
- spec/unit/mutant/mutator/node/super/mutation_spec.rb
|