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
|
# Matcher for memoized instance methods
|
||||||
class Memoized < self
|
class Memoized < self
|
||||||
|
SUBJECT_CLASS = Subject::Method::Instance::Memoized
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ module Mutant
|
||||||
class Subject < self
|
class Subject < self
|
||||||
|
|
||||||
handle(Mutant::Subject::Method::Instance)
|
handle(Mutant::Subject::Method::Instance)
|
||||||
|
handle(Mutant::Subject::Method::Instance::Memoized)
|
||||||
handle(Mutant::Subject::Method::Singleton)
|
handle(Mutant::Subject::Method::Singleton)
|
||||||
|
|
||||||
# Run subject results printer
|
# Run subject results printer
|
||||||
|
|
|
@ -96,6 +96,7 @@ module Mutant
|
||||||
# Instance method dm2 style method lookup
|
# Instance method dm2 style method lookup
|
||||||
class Instance < self
|
class Instance < self
|
||||||
handle(Subject::Method::Instance)
|
handle(Subject::Method::Instance)
|
||||||
|
handle(Subject::Method::Instance::Memoized)
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ module Mutant
|
||||||
|
|
||||||
# Mutator for memoized instance methods
|
# Mutator for memoized instance methods
|
||||||
class Memoized < self
|
class Memoized < self
|
||||||
|
include NodeHelpers
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@ -41,6 +42,16 @@ module Mutant
|
||||||
end
|
end
|
||||||
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
|
# Return memoizer node for mutant
|
||||||
#
|
#
|
||||||
# @param [Parser::AST::Node] mutant
|
# @param [Parser::AST::Node] mutant
|
||||||
|
|
Loading…
Add table
Reference in a new issue