2014-06-02 08:57:14 -04:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2014-08-11 11:21:03 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'a > b'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'a == b'
|
2014-11-25 15:44:05 -05:00
|
|
|
mutation 'a >= b'
|
2014-08-11 11:21:03 -04:00
|
|
|
mutation 'a.eql?(b)'
|
|
|
|
mutation 'a.equal?(b)'
|
|
|
|
mutation 'nil > b'
|
|
|
|
mutation 'self > b'
|
|
|
|
mutation 'a > nil'
|
|
|
|
mutation 'a > self'
|
|
|
|
mutation 'a'
|
|
|
|
mutation 'b'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'a >= b'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'a > b'
|
|
|
|
mutation 'a == b'
|
|
|
|
mutation 'a.eql?(b)'
|
|
|
|
mutation 'a.equal?(b)'
|
|
|
|
mutation 'nil >= b'
|
|
|
|
mutation 'self >= b'
|
|
|
|
mutation 'a >= nil'
|
|
|
|
mutation 'a >= self'
|
|
|
|
mutation 'a'
|
|
|
|
mutation 'b'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'a <= b'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'a < b'
|
|
|
|
mutation 'a == b'
|
|
|
|
mutation 'a.eql?(b)'
|
|
|
|
mutation 'a.equal?(b)'
|
|
|
|
mutation 'nil <= b'
|
|
|
|
mutation 'self <= b'
|
|
|
|
mutation 'a <= nil'
|
|
|
|
mutation 'a <= self'
|
|
|
|
mutation 'a'
|
|
|
|
mutation 'b'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'a < b'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'a == b'
|
2014-11-25 15:44:05 -05:00
|
|
|
mutation 'a <= b'
|
2014-08-11 11:21:03 -04:00
|
|
|
mutation 'a.eql?(b)'
|
|
|
|
mutation 'a.equal?(b)'
|
|
|
|
mutation 'nil < b'
|
|
|
|
mutation 'self < b'
|
|
|
|
mutation 'a < nil'
|
|
|
|
mutation 'a < self'
|
|
|
|
mutation 'a'
|
|
|
|
mutation 'b'
|
|
|
|
end
|
|
|
|
|
2014-06-02 08:57:14 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'reverse_each'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'each'
|
|
|
|
end
|
|
|
|
|
2014-08-11 11:11:00 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'reverse_merge'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'merge'
|
|
|
|
end
|
|
|
|
|
2014-06-02 08:57:14 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'reverse_map'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'map'
|
|
|
|
mutation 'each'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'map'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'each'
|
|
|
|
end
|
|
|
|
|
2014-07-10 15:42:34 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo.to_s'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.to_s'
|
|
|
|
mutation 'foo.to_str'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo.to_a'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.to_a'
|
|
|
|
mutation 'foo.to_ary'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo.to_i'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.to_i'
|
|
|
|
mutation 'foo.to_int'
|
|
|
|
end
|
|
|
|
|
2014-06-02 08:57:14 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo == bar'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
|
|
|
mutation 'bar'
|
|
|
|
mutation 'nil == bar'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'self == bar'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo == nil'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'foo == self'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo.eql?(bar)'
|
|
|
|
mutation 'foo.equal?(bar)'
|
|
|
|
end
|
|
|
|
|
2014-07-25 13:33:01 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo.is_a?(bar)'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'bar'
|
|
|
|
mutation 'foo.is_a?'
|
|
|
|
mutation 'foo.is_a?(nil)'
|
|
|
|
mutation 'foo.is_a?(self)'
|
|
|
|
mutation 'self.is_a?(bar)'
|
|
|
|
mutation 'foo.instance_of?(bar)'
|
|
|
|
end
|
|
|
|
|
2014-10-07 20:13:43 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo.is_a?(bar)'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'bar'
|
|
|
|
mutation 'foo.is_a?'
|
|
|
|
mutation 'foo.is_a?(nil)'
|
|
|
|
mutation 'foo.is_a?(self)'
|
|
|
|
mutation 'self.is_a?(bar)'
|
|
|
|
mutation 'foo.instance_of?(bar)'
|
|
|
|
end
|
|
|
|
|
2014-07-25 13:33:01 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo.kind_of?(bar)'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'bar'
|
|
|
|
mutation 'foo.kind_of?'
|
|
|
|
mutation 'foo.kind_of?(nil)'
|
|
|
|
mutation 'foo.kind_of?(self)'
|
|
|
|
mutation 'self.kind_of?(bar)'
|
|
|
|
mutation 'foo.instance_of?(bar)'
|
|
|
|
end
|
|
|
|
|
2014-06-02 08:57:14 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo.gsub(a, b)'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
|
|
|
mutation 'foo.gsub(a)'
|
|
|
|
mutation 'foo.gsub(b)'
|
|
|
|
mutation 'foo.gsub'
|
|
|
|
mutation 'foo.sub(a, b)'
|
|
|
|
mutation 'foo.gsub(a, nil)'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'foo.gsub(a, self)'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo.gsub(nil, b)'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'foo.gsub(self, b)'
|
|
|
|
mutation 'self.gsub(a, b)'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
2014-11-27 17:01:53 -05:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo.__send__(bar)'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo.__send__'
|
|
|
|
mutation 'foo.public_send(bar)'
|
|
|
|
mutation 'bar'
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.__send__(bar)'
|
|
|
|
mutation 'foo.__send__(nil)'
|
|
|
|
mutation 'foo.__send__(self)'
|
|
|
|
end
|
|
|
|
|
2014-06-02 08:57:14 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo.send(bar)'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo.send'
|
|
|
|
mutation 'foo.public_send(bar)'
|
2014-11-27 17:01:53 -05:00
|
|
|
mutation 'foo.__send__(bar)'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'bar'
|
|
|
|
mutation 'foo'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'self.send(bar)'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo.send(nil)'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'foo.send(self)'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
2014-06-05 12:37:31 -04:00
|
|
|
source 'self.bar = baz'
|
2014-06-02 08:57:14 -04:00
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
|
|
|
mutation 'self.bar = nil'
|
|
|
|
mutation 'self.bar = self'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'self.bar'
|
|
|
|
mutation 'baz'
|
|
|
|
# This one could probably be removed
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
2014-06-05 12:37:31 -04:00
|
|
|
source 'foo.bar = baz'
|
2014-06-02 08:57:14 -04:00
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'foo.bar = nil'
|
|
|
|
mutation 'foo.bar = self'
|
|
|
|
mutation 'self.bar = baz'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo.bar'
|
|
|
|
mutation 'baz'
|
|
|
|
# This one could probably be removed
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
2014-06-15 11:34:45 -04:00
|
|
|
source 'foo[bar] = baz'
|
2014-06-02 08:57:14 -04:00
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
2014-06-15 11:34:45 -04:00
|
|
|
mutation 'foo[bar]'
|
|
|
|
mutation 'foo[bar] = self'
|
|
|
|
mutation 'foo[bar] = nil'
|
|
|
|
mutation 'foo[nil] = baz'
|
|
|
|
mutation 'foo[self] = baz'
|
|
|
|
mutation 'foo[] = baz'
|
|
|
|
mutation 'baz'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo(*bar)'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
|
|
|
mutation 'foo(nil)'
|
|
|
|
mutation 'foo(bar)'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'foo(self)'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo(*nil)'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'foo(*self)'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo(&bar)'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'self.foo'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
|
|
|
end
|
|
|
|
|
|
|
|
Unparser::Constants::KEYWORDS.each do |keyword|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source "self.#{keyword}"
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo.bar'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'self.bar'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'self.class.foo'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'self.class'
|
|
|
|
mutation 'self.foo'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo(nil)'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'self.foo(nil)'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'self.foo'
|
|
|
|
mutation 'foo(nil)'
|
|
|
|
end
|
|
|
|
|
|
|
|
Unparser::Constants::KEYWORDS.each do |keyword|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source "foo.#{keyword}(nil)"
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
|
|
|
mutation "self.#{keyword}(nil)"
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation "foo.#{keyword}"
|
|
|
|
mutation 'foo'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo(nil, nil)'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo()'
|
|
|
|
mutation 'foo(nil)'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source '(left - right) / foo'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
|
|
|
mutation '(left - right)'
|
|
|
|
mutation 'left / foo'
|
|
|
|
mutation 'right / foo'
|
|
|
|
mutation '(left - right) / nil'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation '(left - right) / self'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation '(left - nil) / foo'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation '(left - self) / foo'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation '(nil - right) / foo'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation '(self - right) / foo'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'nil / foo'
|
2014-06-05 12:37:31 -04:00
|
|
|
mutation 'self / foo'
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
2014-06-15 09:12:11 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo[1]'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation '1'
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'foo[]'
|
|
|
|
mutation 'self[1]'
|
|
|
|
mutation 'foo[0]'
|
|
|
|
mutation 'foo[2]'
|
|
|
|
mutation 'foo[-1]'
|
|
|
|
mutation 'foo[nil]'
|
|
|
|
mutation 'foo[self]'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'self.foo[]'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'self.foo'
|
|
|
|
mutation 'self[]'
|
|
|
|
mutation 'foo[]'
|
|
|
|
end
|
|
|
|
|
2014-06-15 15:48:27 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'self[foo]'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'self[self]'
|
|
|
|
mutation 'self[nil]'
|
|
|
|
mutation 'self[]'
|
|
|
|
mutation 'foo'
|
|
|
|
end
|
|
|
|
|
2014-06-15 09:12:11 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source 'foo[*bar]'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'foo[]'
|
|
|
|
mutation 'foo[nil]'
|
|
|
|
mutation 'foo[self]'
|
|
|
|
mutation 'foo[bar]'
|
|
|
|
mutation 'foo[*self]'
|
|
|
|
mutation 'foo[*nil]'
|
|
|
|
mutation 'self[*bar]'
|
|
|
|
end
|
|
|
|
|
2014-08-11 11:21:03 -04:00
|
|
|
(Mutant::AST::Types::BINARY_METHOD_OPERATORS - [:<=, :>=, :<, :>, :==, :eql?]).each do |operator|
|
2014-06-02 08:57:14 -04:00
|
|
|
Mutant::Meta::Example.add do
|
|
|
|
source "true #{operator} false"
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
|
|
|
mutation 'true'
|
|
|
|
mutation 'false'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation "false #{operator} false"
|
|
|
|
mutation "nil #{operator} false"
|
|
|
|
mutation "true #{operator} true"
|
|
|
|
mutation "true #{operator} nil"
|
|
|
|
end
|
|
|
|
end
|