Class: Mutant::Mutation Private
- Inherits:
-
Object
- Object
- Mutant::Mutation
- Includes:
- AbstractType, Adamantium::Flat
- Defined in:
- lib/mutant/mutation.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represent a mutated node with its subject
Defined Under Namespace
Constant Summary collapse
- CODE_DELIMITER =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"\0".freeze
- CODE_RANGE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
(0..4).freeze
Class Method Summary collapse
-
.success?(test_result) ⇒ Boolean
private
Test if mutation is killed by test reports.
Instance Method Summary collapse
-
#code ⇒ String
private
Mutation code.
-
#identification ⇒ String
private
Identification string.
-
#insert(kernel) ⇒ self
private
Insert mutated node.
-
#original_source ⇒ String
private
Normalized original source.
-
#source ⇒ String
private
Normalized mutation source.
Class Method Details
.success?(test_result) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if mutation is killed by test reports
46 47 48 |
# File 'lib/mutant/mutation.rb', line 46 def self.success?(test_result) self::TEST_PASS_SUCCESS.equal?(test_result.passed) end |
Instance Method Details
#code ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Mutation code
21 22 23 |
# File 'lib/mutant/mutation.rb', line 21 def code sha1[CODE_RANGE] end |
#identification ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Identification string
13 14 15 |
# File 'lib/mutant/mutation.rb', line 13 def identification "#{self.class::SYMBOL}:#{subject.identification}:#{code}" end |
#insert(kernel) ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Insert mutated node
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/mutant/mutation.rb', line 55 def insert(kernel) subject.prepare Loader.call( binding: TOPLEVEL_BINDING, kernel: kernel, node: root, subject: subject ) self end |
#original_source ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Normalized original source
37 38 39 |
# File 'lib/mutant/mutation.rb', line 37 def original_source subject.source end |
#source ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Normalized mutation source
29 30 31 |
# File 'lib/mutant/mutation.rb', line 29 def source Unparser.unparse(node) end |