Correctly emit memoizers for memoized method mutations
This commit is contained in:
parent
2051731fbd
commit
023df844f9
4 changed files with 14 additions and 0 deletions
|
@ -59,6 +59,7 @@ module Mutant
|
|||
|
||||
# Matcher for memoized instance methods
|
||||
class Memoized < self
|
||||
SUBJECT_CLASS = Subject::Method::Instance::Memoized
|
||||
|
||||
private
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ module Mutant
|
|||
class Subject < self
|
||||
|
||||
handle(Mutant::Subject::Method::Instance)
|
||||
handle(Mutant::Subject::Method::Instance::Memoized)
|
||||
handle(Mutant::Subject::Method::Singleton)
|
||||
|
||||
# Run subject results printer
|
||||
|
|
|
@ -96,6 +96,7 @@ module Mutant
|
|||
# Instance method dm2 style method lookup
|
||||
class Instance < self
|
||||
handle(Subject::Method::Instance)
|
||||
handle(Subject::Method::Instance::Memoized)
|
||||
|
||||
private
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ module Mutant
|
|||
|
||||
# Mutator for memoized instance methods
|
||||
class Memoized < self
|
||||
include NodeHelpers
|
||||
|
||||
private
|
||||
|
||||
|
@ -41,6 +42,16 @@ module Mutant
|
|||
end
|
||||
end
|
||||
|
||||
# Return neutral mutation
|
||||
#
|
||||
# @return [Mutation::Neutral]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def noop_mutation
|
||||
Mutation::Neutral::Noop.new(self, memoizer_node(node))
|
||||
end
|
||||
|
||||
# Return memoizer node for mutant
|
||||
#
|
||||
# @param [Parser::AST::Node] mutant
|
||||
|
|
Loading…
Add table
Reference in a new issue