mutant 0.8.8 → 0.8.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +9 -0
- data/README.md +1 -1
- data/Rakefile +12 -8
- data/bin/mutant +5 -1
- data/config/flay.yml +1 -1
- data/lib/mutant.rb +18 -17
- data/lib/mutant/actor.rb +1 -7
- data/lib/mutant/actor/env.rb +0 -4
- data/lib/mutant/actor/mailbox.rb +0 -4
- data/lib/mutant/actor/receiver.rb +0 -4
- data/lib/mutant/actor/sender.rb +0 -2
- data/lib/mutant/ast.rb +1 -5
- data/lib/mutant/ast/meta/const.rb +0 -2
- data/lib/mutant/ast/meta/optarg.rb +0 -2
- data/lib/mutant/ast/meta/send.rb +0 -12
- data/lib/mutant/ast/named_children.rb +0 -10
- data/lib/mutant/ast/sexp.rb +1 -5
- data/lib/mutant/cli.rb +19 -38
- data/lib/mutant/color.rb +1 -7
- data/lib/mutant/config.rb +11 -7
- data/lib/mutant/context.rb +0 -4
- data/lib/mutant/context/scope.rb +0 -18
- data/lib/mutant/delegator.rb +0 -6
- data/lib/mutant/diff.rb +0 -18
- data/lib/mutant/env.rb +8 -24
- data/lib/mutant/env/bootstrap.rb +18 -41
- data/lib/mutant/expression.rb +0 -8
- data/lib/mutant/expression/method.rb +6 -7
- data/lib/mutant/expression/methods.rb +5 -9
- data/lib/mutant/expression/namespace.rb +0 -13
- data/lib/mutant/expression/parser.rb +0 -6
- data/lib/mutant/integration.rb +2 -20
- data/lib/mutant/isolation.rb +0 -4
- data/lib/mutant/loader.rb +20 -35
- data/lib/mutant/matcher.rb +1 -1
- data/lib/mutant/matcher/chain.rb +1 -3
- data/lib/mutant/matcher/compiler.rb +0 -8
- data/lib/mutant/matcher/config.rb +2 -10
- data/lib/mutant/matcher/filter.rb +1 -3
- data/lib/mutant/matcher/method.rb +4 -26
- data/lib/mutant/matcher/method/instance.rb +1 -7
- data/lib/mutant/matcher/method/singleton.rb +0 -12
- data/lib/mutant/matcher/methods.rb +1 -19
- data/lib/mutant/matcher/namespace.rb +1 -7
- data/lib/mutant/matcher/null.rb +1 -3
- data/lib/mutant/matcher/scope.rb +1 -5
- data/lib/mutant/matcher/static.rb +0 -2
- data/lib/mutant/meta.rb +0 -2
- data/lib/mutant/meta/example.rb +0 -28
- data/lib/mutant/meta/example/dsl.rb +2 -16
- data/lib/mutant/mutation.rb +9 -18
- data/lib/mutant/mutator.rb +0 -24
- data/lib/mutant/mutator/node.rb +1 -33
- data/lib/mutant/mutator/node/and_asgn.rb +0 -2
- data/lib/mutant/mutator/node/argument.rb +0 -10
- data/lib/mutant/mutator/node/arguments.rb +0 -12
- data/lib/mutant/mutator/node/begin.rb +0 -4
- data/lib/mutant/mutator/node/binary.rb +2 -11
- data/lib/mutant/mutator/node/block.rb +0 -6
- data/lib/mutant/mutator/node/break.rb +0 -2
- data/lib/mutant/mutator/node/case.rb +0 -6
- data/lib/mutant/mutator/node/conditional_loop.rb +0 -2
- data/lib/mutant/mutator/node/const.rb +1 -3
- data/lib/mutant/mutator/node/define.rb +4 -11
- data/lib/mutant/mutator/node/defined.rb +0 -2
- data/lib/mutant/mutator/node/dstr.rb +0 -2
- data/lib/mutant/mutator/node/dsym.rb +0 -2
- data/lib/mutant/mutator/node/generic.rb +1 -3
- data/lib/mutant/mutator/node/if.rb +0 -8
- data/lib/mutant/mutator/node/kwbegin.rb +0 -2
- data/lib/mutant/mutator/node/literal/array.rb +0 -4
- data/lib/mutant/mutator/node/literal/boolean.rb +0 -2
- data/lib/mutant/mutator/node/literal/fixnum.rb +0 -6
- data/lib/mutant/mutator/node/literal/float.rb +0 -6
- data/lib/mutant/mutator/node/literal/hash.rb +0 -6
- data/lib/mutant/mutator/node/literal/nil.rb +0 -2
- data/lib/mutant/mutator/node/literal/range.rb +0 -8
- data/lib/mutant/mutator/node/literal/regex.rb +0 -4
- data/lib/mutant/mutator/node/literal/string.rb +0 -2
- data/lib/mutant/mutator/node/literal/symbol.rb +0 -2
- data/lib/mutant/mutator/node/masgn.rb +0 -2
- data/lib/mutant/mutator/node/match_current_line.rb +0 -2
- data/lib/mutant/mutator/node/mlhs.rb +0 -2
- data/lib/mutant/mutator/node/named_value/access.rb +0 -8
- data/lib/mutant/mutator/node/named_value/constant_assignment.rb +1 -7
- data/lib/mutant/mutator/node/named_value/variable_assignment.rb +0 -4
- data/lib/mutant/mutator/node/next.rb +0 -2
- data/lib/mutant/mutator/node/noop.rb +0 -2
- data/lib/mutant/mutator/node/nthref.rb +0 -2
- data/lib/mutant/mutator/node/op_asgn.rb +0 -2
- data/lib/mutant/mutator/node/or_asgn.rb +0 -2
- data/lib/mutant/mutator/node/resbody.rb +0 -4
- data/lib/mutant/mutator/node/rescue.rb +0 -10
- data/lib/mutant/mutator/node/return.rb +0 -2
- data/lib/mutant/mutator/node/send.rb +4 -32
- data/lib/mutant/mutator/node/send/attribute_assignment.rb +0 -6
- data/lib/mutant/mutator/node/send/binary.rb +0 -6
- data/lib/mutant/mutator/node/send/index.rb +0 -6
- data/lib/mutant/mutator/node/splat.rb +0 -2
- data/lib/mutant/mutator/node/super.rb +0 -2
- data/lib/mutant/mutator/node/when.rb +0 -10
- data/lib/mutant/mutator/node/yield.rb +0 -2
- data/lib/mutant/mutator/node/zsuper.rb +0 -2
- data/lib/mutant/mutator/registry.rb +0 -6
- data/lib/mutant/mutator/util.rb +0 -4
- data/lib/mutant/mutator/util/array.rb +0 -6
- data/lib/mutant/mutator/util/symbol.rb +0 -2
- data/lib/mutant/parallel.rb +21 -17
- data/lib/mutant/parallel/master.rb +0 -28
- data/lib/mutant/parallel/source.rb +0 -10
- data/lib/mutant/parallel/worker.rb +15 -10
- data/lib/mutant/parser.rb +23 -0
- data/lib/mutant/reporter.rb +5 -8
- data/lib/mutant/reporter/cli.rb +1 -15
- data/lib/mutant/reporter/cli/format.rb +3 -25
- data/lib/mutant/reporter/cli/printer.rb +0 -18
- data/lib/mutant/reporter/cli/printer/config.rb +0 -2
- data/lib/mutant/reporter/cli/printer/env_progress.rb +0 -2
- data/lib/mutant/reporter/cli/printer/env_result.rb +0 -2
- data/lib/mutant/reporter/cli/printer/mutation_progress_result.rb +0 -4
- data/lib/mutant/reporter/cli/printer/mutation_result.rb +0 -16
- data/lib/mutant/reporter/cli/printer/status.rb +0 -6
- data/lib/mutant/reporter/cli/printer/status_progressive.rb +0 -4
- data/lib/mutant/reporter/cli/printer/subject_progress.rb +0 -8
- data/lib/mutant/reporter/cli/printer/subject_result.rb +0 -2
- data/lib/mutant/reporter/cli/printer/test_result.rb +0 -2
- data/lib/mutant/reporter/cli/tput.rb +0 -4
- data/lib/mutant/repository.rb +4 -22
- data/lib/mutant/require_highjack.rb +0 -2
- data/lib/mutant/result.rb +23 -43
- data/lib/mutant/runner.rb +7 -20
- data/lib/mutant/runner/sink.rb +43 -86
- data/lib/mutant/selector.rb +0 -2
- data/lib/mutant/selector/expression.rb +0 -2
- data/lib/mutant/subject.rb +0 -22
- data/lib/mutant/subject/method.rb +2 -10
- data/lib/mutant/subject/method/instance.rb +0 -6
- data/lib/mutant/subject/method/singleton.rb +0 -2
- data/lib/mutant/test.rb +4 -3
- data/lib/mutant/version.rb +1 -1
- data/lib/mutant/warning_filter.rb +0 -10
- data/lib/mutant/zombifier.rb +5 -20
- data/meta/or_asgn.rb +6 -0
- data/meta/send.rb +29 -0
- data/mutant-rspec.gemspec +1 -1
- data/spec/integration/mutant/rspec_spec.rb +1 -1
- data/spec/integrations.yml +2 -3
- data/spec/shared/method_matcher_behavior.rb +7 -7
- data/spec/spec_helper.rb +2 -9
- data/spec/support/corpus.rb +37 -30
- data/spec/support/rb_bug.rb +1 -2
- data/spec/support/ruby_vm.rb +6 -3
- data/spec/support/shared_context.rb +19 -20
- data/spec/unit/mutant/actor/binding_spec.rb +6 -6
- data/spec/unit/mutant/actor/env_spec.rb +2 -2
- data/spec/unit/mutant/actor/mailbox_spec.rb +6 -6
- data/spec/unit/mutant/actor/message_spec.rb +2 -2
- data/spec/unit/mutant/actor/receiver_spec.rb +4 -4
- data/spec/unit/mutant/actor/sender_spec.rb +6 -6
- data/spec/unit/mutant/ast_spec.rb +9 -0
- data/spec/unit/mutant/cli_spec.rb +16 -10
- data/spec/unit/mutant/context/scope/root_spec.rb +1 -1
- data/spec/unit/mutant/context/scope/unqualified_name_spec.rb +1 -1
- data/spec/unit/mutant/context/scope_spec.rb +3 -3
- data/spec/unit/mutant/context_spec.rb +0 -22
- data/spec/unit/mutant/env/boostrap_spec.rb +34 -41
- data/spec/unit/mutant/env_spec.rb +74 -32
- data/spec/unit/mutant/integration/rspec_spec.rb +23 -17
- data/spec/unit/mutant/integration_spec.rb +4 -4
- data/spec/unit/mutant/isolation_spec.rb +4 -4
- data/spec/unit/mutant/loader_spec.rb +42 -0
- data/spec/unit/mutant/matcher/compiler_spec.rb +3 -3
- data/spec/unit/mutant/matcher/config_spec.rb +1 -1
- data/spec/unit/mutant/matcher/method/instance_spec.rb +8 -1
- data/spec/unit/mutant/matcher/method/singleton_spec.rb +8 -1
- data/spec/unit/mutant/matcher/namespace_spec.rb +7 -8
- data/spec/unit/mutant/matcher/null_spec.rb +3 -2
- data/spec/unit/mutant/mutation_spec.rb +11 -5
- data/spec/unit/mutant/mutator/registry_spec.rb +1 -1
- data/spec/unit/mutant/parallel/master_spec.rb +9 -9
- data/spec/unit/mutant/parallel/source/array_spec.rb +3 -3
- data/spec/unit/mutant/parallel/worker_spec.rb +5 -5
- data/spec/unit/mutant/parallel_spec.rb +4 -4
- data/spec/unit/mutant/parser_spec.rb +24 -0
- data/spec/unit/mutant/reporter/cli/printer_spec.rb +3 -3
- data/spec/unit/mutant/reporter/cli/tput_spec.rb +2 -2
- data/spec/unit/mutant/reporter/cli_spec.rb +7 -7
- data/spec/unit/mutant/reporter/null_spec.rb +5 -4
- data/spec/unit/mutant/repository/diff_spec.rb +30 -18
- data/spec/unit/mutant/repository/subject_filter_spec.rb +5 -5
- data/spec/unit/mutant/require_highjack_spec.rb +1 -1
- data/spec/unit/mutant/result/env_spec.rb +9 -9
- data/spec/unit/mutant/result/subject_spec.rb +5 -5
- data/spec/unit/mutant/runner/driver_spec.rb +4 -4
- data/spec/unit/mutant/runner/{sink/mutation_spec.rb → sink_spec.rb} +16 -4
- data/spec/unit/mutant/runner_spec.rb +31 -31
- data/spec/unit/mutant/selector/expression_spec.rb +8 -8
- data/spec/unit/mutant/subject/method/instance_spec.rb +9 -3
- data/spec/unit/mutant/subject/method/singleton_spec.rb +1 -1
- data/spec/unit/mutant/subject_spec.rb +1 -5
- data/spec/unit/mutant_spec.rb +3 -3
- metadata +9 -15
- data/config/mutant.yml +0 -14
- data/lib/mutant/cache.rb +0 -29
- data/lib/mutant/reporter/trace.rb +0 -36
- data/spec/support/rspec.rb +0 -21
- data/spec/unit/mutant/cache_spec.rb +0 -22
- data/spec/unit/mutant/loader/eval_spec.rb +0 -44
- data/spec/unit/mutant/reporter/trace_spec.rb +0 -21
- data/test_app/Gemfile.rspec3.2 +0 -7
@@ -12,8 +12,6 @@ module Mutant
|
|
12
12
|
# Emit mutants
|
13
13
|
#
|
14
14
|
# @return [undefined]
|
15
|
-
#
|
16
|
-
# @api private
|
17
15
|
def dispatch
|
18
16
|
Util::Array.each(children, self, &method(:emit_child_subset))
|
19
17
|
children.each_with_index do |child, index|
|
@@ -27,8 +25,6 @@ module Mutant
|
|
27
25
|
# @param [Array<Parser::AST::Node>] children
|
28
26
|
#
|
29
27
|
# @return [undefined]
|
30
|
-
#
|
31
|
-
# @api private
|
32
28
|
def emit_child_subset(children)
|
33
29
|
return if children.length < 2
|
34
30
|
emit_type(*children)
|
@@ -18,8 +18,6 @@ module Mutant
|
|
18
18
|
# Emit mutations
|
19
19
|
#
|
20
20
|
# @return [undefined]
|
21
|
-
#
|
22
|
-
# @api private
|
23
21
|
def dispatch
|
24
22
|
emit_singletons
|
25
23
|
emit_promotions
|
@@ -32,8 +30,6 @@ module Mutant
|
|
32
30
|
# Emit operator mutations
|
33
31
|
#
|
34
32
|
# @return [undefined]
|
35
|
-
#
|
36
|
-
# @api private
|
37
33
|
def emit_operator_mutations
|
38
34
|
emit(s(INVERSE.fetch(node.type), left, right))
|
39
35
|
end
|
@@ -41,9 +37,6 @@ module Mutant
|
|
41
37
|
# Emit promotions
|
42
38
|
#
|
43
39
|
# @return [undefined]
|
44
|
-
#
|
45
|
-
# @api private
|
46
|
-
#
|
47
40
|
def emit_promotions
|
48
41
|
emit(left)
|
49
42
|
emit(right)
|
@@ -54,17 +47,15 @@ module Mutant
|
|
54
47
|
# We do not emit right negation as the `and` and `or` nodes
|
55
48
|
# in ruby are also used for control flow.
|
56
49
|
#
|
57
|
-
#
|
50
|
+
# Irrespective of their syntax, aka `||` parses internally to `or`.
|
58
51
|
#
|
59
52
|
# `do_a or do_b`. Negating left makes sense, negating right
|
60
|
-
# only when the result is
|
53
|
+
# only when the result is actually used.
|
61
54
|
#
|
62
55
|
# It *would* be possible to emit the right negation in case the use of the result is proved.
|
63
56
|
# Like parent is an assignment to an {l,i}var. Dunno if we ever get the time to do that.
|
64
57
|
#
|
65
58
|
# @return [undefined]
|
66
|
-
#
|
67
|
-
# @api private
|
68
59
|
def emit_left_negation
|
69
60
|
emit(s(node.type, n_not(left), right))
|
70
61
|
end
|
@@ -13,8 +13,6 @@ module Mutant
|
|
13
13
|
# Emit mutants
|
14
14
|
#
|
15
15
|
# @return [undefined]
|
16
|
-
#
|
17
|
-
# @api private
|
18
16
|
def dispatch
|
19
17
|
emit_singletons
|
20
18
|
emit(send)
|
@@ -27,8 +25,6 @@ module Mutant
|
|
27
25
|
# Emit body mutations
|
28
26
|
#
|
29
27
|
# @return [undefined]
|
30
|
-
#
|
31
|
-
# @api private
|
32
28
|
def mutate_body
|
33
29
|
emit_body(nil)
|
34
30
|
emit_body(N_RAISE)
|
@@ -43,8 +39,6 @@ module Mutant
|
|
43
39
|
# Mutate method send in body scope of `send`
|
44
40
|
#
|
45
41
|
# @return [undefined]
|
46
|
-
#
|
47
|
-
# @api private
|
48
42
|
def mutate_body_receiver
|
49
43
|
return unless n_send?(body)
|
50
44
|
|
@@ -14,8 +14,6 @@ module Mutant
|
|
14
14
|
# Emit mutations
|
15
15
|
#
|
16
16
|
# @return [undefined]
|
17
|
-
#
|
18
|
-
# @api private
|
19
17
|
def dispatch
|
20
18
|
emit_singletons
|
21
19
|
emit_condition_mutations if condition
|
@@ -26,8 +24,6 @@ module Mutant
|
|
26
24
|
# Emit when mutations
|
27
25
|
#
|
28
26
|
# @return [undefined]
|
29
|
-
#
|
30
|
-
# @api private
|
31
27
|
def emit_when_mutations
|
32
28
|
indices = children.each_index.drop(1).take(children.length - 2)
|
33
29
|
one = indices.one?
|
@@ -40,8 +36,6 @@ module Mutant
|
|
40
36
|
# Emit else mutations
|
41
37
|
#
|
42
38
|
# @return [undefined]
|
43
|
-
#
|
44
|
-
# @api private
|
45
39
|
def emit_else_mutations
|
46
40
|
else_branch = children.last
|
47
41
|
else_index = children.length - 1
|
@@ -12,13 +12,11 @@ module Mutant
|
|
12
12
|
# Emit mutations
|
13
13
|
#
|
14
14
|
# @return [undefined]
|
15
|
-
#
|
16
|
-
# @api private
|
17
15
|
def dispatch
|
18
16
|
emit_singletons unless parent_node && n_const?(parent_node)
|
19
17
|
emit_type(nil, *children.drop(1))
|
20
18
|
children.each_with_index do |child, index|
|
21
|
-
mutate_child(index) if child.instance_of?(Parser::AST::Node)
|
19
|
+
mutate_child(index) if child.instance_of?(::Parser::AST::Node)
|
22
20
|
end
|
23
21
|
end
|
24
22
|
|
@@ -9,8 +9,6 @@ module Mutant
|
|
9
9
|
# Emit mutations
|
10
10
|
#
|
11
11
|
# @return [undefined]
|
12
|
-
#
|
13
|
-
# @api private
|
14
12
|
def dispatch
|
15
13
|
emit_arguments_mutations
|
16
14
|
emit_optarg_body_assignments
|
@@ -23,8 +21,6 @@ module Mutant
|
|
23
21
|
# Emit mutations with optional arguments as assignments in method
|
24
22
|
#
|
25
23
|
# @return [undefined]
|
26
|
-
#
|
27
|
-
# @api private
|
28
24
|
def emit_optarg_body_assignments
|
29
25
|
arguments.children.each do |argument|
|
30
26
|
next unless n_optarg?(argument) && AST::Meta::Optarg.new(argument).used?
|
@@ -33,11 +29,9 @@ module Mutant
|
|
33
29
|
end
|
34
30
|
end
|
35
31
|
|
36
|
-
# Emit mutation with arg splat as empty array
|
32
|
+
# Emit mutation with arg splat as empty array assignment in method
|
37
33
|
#
|
38
34
|
# @return [undefined]
|
39
|
-
#
|
40
|
-
# @api private
|
41
35
|
def emit_restarg_body_mutation
|
42
36
|
arguments.children.each do |argument|
|
43
37
|
next unless n_restarg?(argument) && argument.children.one?
|
@@ -51,8 +45,6 @@ module Mutant
|
|
51
45
|
# @param node [Parser::AST::Node]
|
52
46
|
#
|
53
47
|
# @return [undefined]
|
54
|
-
#
|
55
|
-
# @api private
|
56
48
|
def emit_body_prepend(node)
|
57
49
|
if body
|
58
50
|
emit_body(s(:begin, node, body))
|
@@ -68,6 +60,9 @@ module Mutant
|
|
68
60
|
|
69
61
|
children :name, :arguments, :body
|
70
62
|
|
63
|
+
# Emit mutations
|
64
|
+
#
|
65
|
+
# @return [undefined]
|
71
66
|
def dispatch
|
72
67
|
super()
|
73
68
|
emit_remove_method
|
@@ -76,8 +71,6 @@ module Mutant
|
|
76
71
|
# Remove an instance method
|
77
72
|
#
|
78
73
|
# @return [undefined]
|
79
|
-
#
|
80
|
-
# @api private
|
81
74
|
def emit_remove_method
|
82
75
|
emit(s(:send, nil, :remove_method, s(:sym, name)))
|
83
76
|
end
|
@@ -21,11 +21,9 @@ module Mutant
|
|
21
21
|
# Emit mutations
|
22
22
|
#
|
23
23
|
# @return [undefined]
|
24
|
-
#
|
25
|
-
# @api private
|
26
24
|
def dispatch
|
27
25
|
children.each_with_index do |child, index|
|
28
|
-
mutate_child(index) if child.instance_of?(Parser::AST::Node)
|
26
|
+
mutate_child(index) if child.instance_of?(::Parser::AST::Node)
|
29
27
|
end
|
30
28
|
end
|
31
29
|
|
@@ -13,8 +13,6 @@ module Mutant
|
|
13
13
|
# Emit mutations
|
14
14
|
#
|
15
15
|
# @return [undefined]
|
16
|
-
#
|
17
|
-
# @api private
|
18
16
|
def dispatch
|
19
17
|
emit_singletons
|
20
18
|
mutate_condition
|
@@ -25,8 +23,6 @@ module Mutant
|
|
25
23
|
# Emit condition mutations
|
26
24
|
#
|
27
25
|
# @return [undefined]
|
28
|
-
#
|
29
|
-
# @api private
|
30
26
|
def mutate_condition
|
31
27
|
emit_condition_mutations do |node|
|
32
28
|
!n_self?(node)
|
@@ -39,8 +35,6 @@ module Mutant
|
|
39
35
|
# Emit if branch mutations
|
40
36
|
#
|
41
37
|
# @return [undefined]
|
42
|
-
#
|
43
|
-
# @api private
|
44
38
|
def mutate_if_branch
|
45
39
|
emit_type(condition, else_branch, nil) if else_branch
|
46
40
|
return unless if_branch
|
@@ -52,8 +46,6 @@ module Mutant
|
|
52
46
|
# Emit else branch mutations
|
53
47
|
#
|
54
48
|
# @return [undefined]
|
55
|
-
#
|
56
|
-
# @api private
|
57
49
|
def mutate_else_branch
|
58
50
|
return unless else_branch
|
59
51
|
emit(else_branch)
|
@@ -12,8 +12,6 @@ module Mutant
|
|
12
12
|
# Emit mutations
|
13
13
|
#
|
14
14
|
# @return [undefined]
|
15
|
-
#
|
16
|
-
# @api private
|
17
15
|
def dispatch
|
18
16
|
emit_singletons
|
19
17
|
emit_type
|
@@ -25,8 +23,6 @@ module Mutant
|
|
25
23
|
# Mutate body
|
26
24
|
#
|
27
25
|
# @return [undefined]
|
28
|
-
#
|
29
|
-
# @api private
|
30
26
|
def mutate_body
|
31
27
|
children.each_index do |index|
|
32
28
|
dup_children = children.dup
|
@@ -12,8 +12,6 @@ module Mutant
|
|
12
12
|
# Emit mutants
|
13
13
|
#
|
14
14
|
# @return [undefined]
|
15
|
-
#
|
16
|
-
# @api private
|
17
15
|
def dispatch
|
18
16
|
emit_singletons
|
19
17
|
emit_values(values)
|
@@ -22,8 +20,6 @@ module Mutant
|
|
22
20
|
# Values to mutate to
|
23
21
|
#
|
24
22
|
# @return [Array]
|
25
|
-
#
|
26
|
-
# @api private
|
27
23
|
def values
|
28
24
|
[0, 1, -value, value + 1, value - 1]
|
29
25
|
end
|
@@ -31,8 +27,6 @@ module Mutant
|
|
31
27
|
# Literal original value
|
32
28
|
#
|
33
29
|
# @return [Object]
|
34
|
-
#
|
35
|
-
# @api private
|
36
30
|
def value
|
37
31
|
children.first
|
38
32
|
end
|
@@ -12,8 +12,6 @@ module Mutant
|
|
12
12
|
# Emit mutants
|
13
13
|
#
|
14
14
|
# @return [undefined]
|
15
|
-
#
|
16
|
-
# @api private
|
17
15
|
def dispatch
|
18
16
|
emit_singletons
|
19
17
|
emit_values(values)
|
@@ -29,8 +27,6 @@ module Mutant
|
|
29
27
|
# Emit special cases
|
30
28
|
#
|
31
29
|
# @return [undefined]
|
32
|
-
#
|
33
|
-
# @api private
|
34
30
|
def emit_special_cases
|
35
31
|
SPECIAL.each(&method(:emit))
|
36
32
|
end
|
@@ -38,8 +34,6 @@ module Mutant
|
|
38
34
|
# Values to mutate to
|
39
35
|
#
|
40
36
|
# @return [Array]
|
41
|
-
#
|
42
|
-
# @api private
|
43
37
|
def values
|
44
38
|
original = children.first
|
45
39
|
# Work around a bug in RBX/MRI or JRUBY:
|
@@ -12,8 +12,6 @@ module Mutant
|
|
12
12
|
# Emit mutations
|
13
13
|
#
|
14
14
|
# @return [undefined]
|
15
|
-
#
|
16
|
-
# @api private
|
17
15
|
def dispatch
|
18
16
|
emit_singletons
|
19
17
|
emit_type
|
@@ -23,8 +21,6 @@ module Mutant
|
|
23
21
|
# Mutate body
|
24
22
|
#
|
25
23
|
# @return [undefined]
|
26
|
-
#
|
27
|
-
# @api private
|
28
24
|
def mutate_body
|
29
25
|
children.each_index do |index|
|
30
26
|
mutate_child(index)
|
@@ -46,8 +42,6 @@ module Mutant
|
|
46
42
|
# Perform dispatch
|
47
43
|
#
|
48
44
|
# @return [undefined]
|
49
|
-
#
|
50
|
-
# @api private
|
51
45
|
def dispatch
|
52
46
|
emit_key_mutations
|
53
47
|
emit_value_mutations
|
@@ -20,8 +20,6 @@ module Mutant
|
|
20
20
|
# Emit mutants
|
21
21
|
#
|
22
22
|
# @return [undefined]
|
23
|
-
#
|
24
|
-
# @api private
|
25
23
|
def dispatch
|
26
24
|
emit_singletons
|
27
25
|
emit_inverse
|
@@ -32,8 +30,6 @@ module Mutant
|
|
32
30
|
# Inverse node
|
33
31
|
#
|
34
32
|
# @return [Parser::AST::Node]
|
35
|
-
#
|
36
|
-
# @api private
|
37
33
|
def emit_inverse
|
38
34
|
emit(s(MAP.fetch(node.type), *children))
|
39
35
|
end
|
@@ -41,8 +37,6 @@ module Mutant
|
|
41
37
|
# Emit range start mutations
|
42
38
|
#
|
43
39
|
# @return [undefined]
|
44
|
-
#
|
45
|
-
# @api private
|
46
40
|
def emit_upper_bound_mutations
|
47
41
|
emit__end_mutations
|
48
42
|
emit_type(N_NAN, _end)
|
@@ -51,8 +45,6 @@ module Mutant
|
|
51
45
|
# Emit start mutations
|
52
46
|
#
|
53
47
|
# @return [undefined]
|
54
|
-
#
|
55
|
-
# @api private
|
56
48
|
def emit_lower_bound_mutations
|
57
49
|
emit_start_mutations
|
58
50
|
emit_type(start, N_INFINITY)
|