2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-08-11 11:21:03 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2015-08-19 19:30:35 -04:00
|
|
|
source 'A.const_get(:B)'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'A::B'
|
|
|
|
mutation 'A.const_get'
|
|
|
|
mutation 'A'
|
|
|
|
mutation ':B'
|
|
|
|
mutation 'A.const_get(nil)'
|
|
|
|
mutation 'A.const_get(self)'
|
|
|
|
mutation 'A.const_get(:B__mutant__)'
|
|
|
|
mutation 'self.const_get(:B)'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2015-08-19 19:30:35 -04:00
|
|
|
source 'A.const_get(bar)'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'A.const_get'
|
|
|
|
mutation 'A'
|
|
|
|
mutation 'bar'
|
|
|
|
mutation 'A.const_get(nil)'
|
|
|
|
mutation 'A.const_get(self)'
|
|
|
|
mutation 'self.const_get(bar)'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2016-02-06 04:59:49 -05:00
|
|
|
source 'method(bar)'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'public_method(bar)'
|
|
|
|
mutation 'method'
|
|
|
|
mutation 'bar'
|
|
|
|
mutation 'method(nil)'
|
|
|
|
mutation 'method(self)'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-08-11 11:21:03 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-08-11 11:21:03 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-08-11 11:21:03 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
source 'reverse_each'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'each'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-08-11 11:11:00 -04:00
|
|
|
source 'reverse_merge'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'merge'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
source 'map'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'each'
|
|
|
|
end
|
|
|
|
|
2016-10-09 21:03:47 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'flat_map'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'map'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-07-10 15:42:34 -04:00
|
|
|
source 'foo.to_s'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.to_s'
|
|
|
|
mutation 'foo.to_str'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-07-10 15:42:34 -04:00
|
|
|
source 'foo.to_a'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.to_a'
|
|
|
|
mutation 'foo.to_ary'
|
2016-02-06 01:36:01 -05:00
|
|
|
mutation 'foo.to_set'
|
2014-07-10 15:42:34 -04:00
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-07-10 15:42:34 -04:00
|
|
|
source 'foo.to_i'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.to_i'
|
|
|
|
mutation 'foo.to_int'
|
2015-10-19 01:34:00 -04:00
|
|
|
mutation 'Integer(foo)'
|
2014-07-10 15:42:34 -04:00
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2015-08-09 23:36:44 -04:00
|
|
|
source 'foo.to_h'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.to_h'
|
|
|
|
mutation 'foo.to_hash'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-07-25 13:33:01 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-10-07 20:13:43 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-07-25 13:33:01 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2015-12-25 13:56:57 -05:00
|
|
|
source 'foo.values_at(a, b)'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo.fetch_values(a, b)'
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.values_at(a, b)'
|
|
|
|
mutation 'foo.values_at(a)'
|
|
|
|
mutation 'foo.values_at(b)'
|
|
|
|
mutation 'foo.values_at(nil, b)'
|
|
|
|
mutation 'foo.values_at(self, b)'
|
|
|
|
mutation 'foo.values_at(a, nil)'
|
|
|
|
mutation 'foo.values_at(a, self)'
|
|
|
|
mutation 'foo.values_at'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2016-02-06 19:06:54 -05:00
|
|
|
source 'foo.dig(a, b)'
|
|
|
|
|
|
|
|
singleton_mutations
|
2016-02-07 15:35:18 -05:00
|
|
|
mutation 'foo.fetch(a).dig(b)'
|
2016-02-06 19:06:54 -05:00
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.dig(a, b)'
|
|
|
|
mutation 'foo.dig(a)'
|
|
|
|
mutation 'foo.dig(b)'
|
|
|
|
mutation 'foo.dig(nil, b)'
|
|
|
|
mutation 'foo.dig(self, b)'
|
|
|
|
mutation 'foo.dig(a, nil)'
|
|
|
|
mutation 'foo.dig(a, self)'
|
|
|
|
mutation 'foo.dig'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2016-02-06 19:06:54 -05:00
|
|
|
source 'foo.dig(a)'
|
|
|
|
|
|
|
|
singleton_mutations
|
2016-02-07 15:35:18 -05:00
|
|
|
mutation 'foo.fetch(a)'
|
2016-02-06 19:06:54 -05:00
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.dig(a)'
|
|
|
|
mutation 'foo.dig(nil)'
|
|
|
|
mutation 'foo.dig(self)'
|
|
|
|
mutation 'foo.dig'
|
|
|
|
mutation 'a'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2016-02-06 19:06:54 -05:00
|
|
|
source 'foo.dig'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'self.dig'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-11-27 17:01:53 -05:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2016-03-06 16:19:32 -05:00
|
|
|
source 'self.booz = baz'
|
2014-06-02 08:57:14 -04:00
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2016-03-06 16:19:32 -05:00
|
|
|
mutation 'self.booz = nil'
|
|
|
|
mutation 'self.booz = self'
|
|
|
|
mutation 'self.booz'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'baz'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2016-03-06 16:19:32 -05:00
|
|
|
source 'foo.booz = 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'
|
2016-03-06 16:19:32 -05:00
|
|
|
mutation 'foo.booz = nil'
|
|
|
|
mutation 'foo.booz = self'
|
|
|
|
mutation 'self.booz = baz'
|
|
|
|
mutation 'foo.booz'
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'baz'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send 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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
source 'foo(&bar)'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
source 'foo'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
source "self.#{keyword}"
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
source 'foo(nil)'
|
|
|
|
|
2014-06-05 12:37:31 -04:00
|
|
|
singleton_mutations
|
2014-06-02 08:57:14 -04:00
|
|
|
mutation 'foo'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2015-12-25 15:43:13 -05:00
|
|
|
source 'self.fetch(nil)'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'self.fetch'
|
|
|
|
mutation 'fetch(nil)'
|
|
|
|
mutation 'self.key?(nil)'
|
|
|
|
end
|
|
|
|
|
2014-06-02 08:57:14 -04:00
|
|
|
Unparser::Constants::KEYWORDS.each do |keyword|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-15 09:12:11 -04:00
|
|
|
source 'foo[1]'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation '1'
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'foo[]'
|
2015-07-05 12:02:46 -04:00
|
|
|
mutation 'foo.at(1)'
|
|
|
|
mutation 'foo.fetch(1)'
|
2015-12-25 15:39:50 -05:00
|
|
|
mutation 'foo.key?(1)'
|
2014-06-15 09:12:11 -04:00
|
|
|
mutation 'self[1]'
|
|
|
|
mutation 'foo[0]'
|
|
|
|
mutation 'foo[2]'
|
|
|
|
mutation 'foo[-1]'
|
|
|
|
mutation 'foo[nil]'
|
|
|
|
mutation 'foo[self]'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-15 09:12:11 -04:00
|
|
|
source 'self.foo[]'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'self.foo'
|
2015-07-05 12:02:46 -04:00
|
|
|
mutation 'self.foo.at()'
|
|
|
|
mutation 'self.foo.fetch()'
|
2015-12-25 15:39:50 -05:00
|
|
|
mutation 'self.foo.key?()'
|
2014-06-15 09:12:11 -04:00
|
|
|
mutation 'self[]'
|
|
|
|
mutation 'foo[]'
|
|
|
|
end
|
|
|
|
|
2016-04-03 19:37:09 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'foo(n..-1)'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'n..-1'
|
|
|
|
mutation 'foo(nil)'
|
|
|
|
mutation 'foo(self)'
|
|
|
|
mutation 'foo(n...-1)'
|
|
|
|
mutation 'foo(nil..-1)'
|
|
|
|
mutation 'foo(self..-1)'
|
|
|
|
mutation 'foo(n..nil)'
|
|
|
|
mutation 'foo(n..self)'
|
|
|
|
mutation 'foo(n..0)'
|
|
|
|
mutation 'foo(n..1)'
|
|
|
|
mutation 'foo(n..-2)'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'foo[n..-2]'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'n..-2'
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'foo[]'
|
|
|
|
mutation 'foo.at(n..-2)'
|
|
|
|
mutation 'foo.fetch(n..-2)'
|
|
|
|
mutation 'foo.key?(n..-2)'
|
|
|
|
mutation 'self[n..-2]'
|
|
|
|
mutation 'foo[nil]'
|
|
|
|
mutation 'foo[self]'
|
|
|
|
mutation 'foo[n..nil]'
|
|
|
|
mutation 'foo[n..self]'
|
|
|
|
mutation 'foo[n..-1]'
|
|
|
|
mutation 'foo[n..2]'
|
|
|
|
mutation 'foo[n..0]'
|
|
|
|
mutation 'foo[n..1]'
|
|
|
|
mutation 'foo[n..-3]'
|
|
|
|
mutation 'foo[n...-2]'
|
|
|
|
mutation 'foo[nil..-2]'
|
|
|
|
mutation 'foo[self..-2]'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'foo[n...-1]'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'n...-1'
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'foo[]'
|
|
|
|
mutation 'foo.at(n...-1)'
|
|
|
|
mutation 'foo.fetch(n...-1)'
|
|
|
|
mutation 'foo.key?(n...-1)'
|
|
|
|
mutation 'self[n...-1]'
|
|
|
|
mutation 'foo[nil]'
|
|
|
|
mutation 'foo[self]'
|
|
|
|
mutation 'foo[n...nil]'
|
|
|
|
mutation 'foo[n...self]'
|
|
|
|
mutation 'foo[n..-1]'
|
|
|
|
mutation 'foo[n...0]'
|
|
|
|
mutation 'foo[n...1]'
|
|
|
|
mutation 'foo[n...-2]'
|
|
|
|
mutation 'foo[nil...-1]'
|
|
|
|
mutation 'foo[self...-1]'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'foo[n..-1]'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'n..-1'
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'foo[]'
|
|
|
|
mutation 'foo.at(n..-1)'
|
|
|
|
mutation 'foo.fetch(n..-1)'
|
|
|
|
mutation 'foo.key?(n..-1)'
|
|
|
|
mutation 'self[n..-1]'
|
|
|
|
mutation 'foo[nil]'
|
|
|
|
mutation 'foo[self]'
|
|
|
|
mutation 'foo[n..nil]'
|
|
|
|
mutation 'foo[n..self]'
|
|
|
|
mutation 'foo[n..0]'
|
|
|
|
mutation 'foo[n..1]'
|
|
|
|
mutation 'foo[n..-2]'
|
|
|
|
mutation 'foo[n...-1]'
|
|
|
|
mutation 'foo[nil..-1]'
|
|
|
|
mutation 'foo[self..-1]'
|
2016-04-03 19:38:23 -04:00
|
|
|
mutation 'foo.drop(n)'
|
2016-04-03 19:37:09 -04:00
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-15 15:48:27 -04:00
|
|
|
source 'self[foo]'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'self[self]'
|
|
|
|
mutation 'self[nil]'
|
|
|
|
mutation 'self[]'
|
2015-07-05 12:02:46 -04:00
|
|
|
mutation 'self.at(foo)'
|
|
|
|
mutation 'self.fetch(foo)'
|
2015-12-25 15:39:50 -05:00
|
|
|
mutation 'self.key?(foo)'
|
2014-06-15 15:48:27 -04:00
|
|
|
mutation 'foo'
|
|
|
|
end
|
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-15 09:12:11 -04:00
|
|
|
source 'foo[*bar]'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation 'foo[]'
|
2015-07-05 12:02:46 -04:00
|
|
|
mutation 'foo.at(*bar)'
|
|
|
|
mutation 'foo.fetch(*bar)'
|
2015-12-25 15:39:50 -05:00
|
|
|
mutation 'foo.key?(*bar)'
|
2014-06-15 09:12:11 -04:00
|
|
|
mutation 'foo[nil]'
|
|
|
|
mutation 'foo[self]'
|
|
|
|
mutation 'foo[bar]'
|
|
|
|
mutation 'foo[*self]'
|
|
|
|
mutation 'foo[*nil]'
|
|
|
|
mutation 'self[*bar]'
|
|
|
|
end
|
|
|
|
|
2015-08-14 03:28:45 -04:00
|
|
|
(Mutant::AST::Types::BINARY_METHOD_OPERATORS - %i[<= >= < > == != eql?]).each do |operator|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2014-06-02 08:57:14 -04:00
|
|
|
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
|
2015-08-14 03:28:45 -04:00
|
|
|
|
2016-03-19 11:13:05 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
2015-08-14 03:28:45 -04:00
|
|
|
source 'a != b'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'nil != b'
|
|
|
|
mutation 'self != b'
|
|
|
|
mutation 'a'
|
|
|
|
mutation 'b'
|
|
|
|
mutation 'a != nil'
|
|
|
|
mutation 'a != self'
|
|
|
|
mutation '!a.eql?(b)'
|
|
|
|
mutation '!a.equal?(b)'
|
|
|
|
end
|
2016-06-14 19:06:01 -04:00
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'sample'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'first'
|
|
|
|
mutation 'last'
|
|
|
|
end
|
|
|
|
|
2016-06-15 02:22:41 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'pop'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'last'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'shift'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'first'
|
|
|
|
end
|
|
|
|
|
2016-06-14 19:06:01 -04:00
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'first'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'last'
|
|
|
|
end
|
2016-06-15 02:22:41 -04:00
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'last'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'first'
|
|
|
|
end
|
2016-10-11 02:10:12 -04:00
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source '!!foo'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation '!foo'
|
|
|
|
mutation '!self'
|
|
|
|
mutation '!!self'
|
2016-10-11 03:01:10 -04:00
|
|
|
mutation 'foo'
|
2016-10-11 02:10:12 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source '!foo'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo'
|
|
|
|
mutation '!self'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source '!foo&.!'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'foo&.!'
|
|
|
|
mutation '!self'
|
|
|
|
mutation '!foo'
|
|
|
|
mutation '!self&.!'
|
|
|
|
mutation '!(!foo)'
|
|
|
|
end
|
2016-10-10 01:09:49 -04:00
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'custom.proc { }'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'custom.proc'
|
|
|
|
mutation 'custom { }'
|
|
|
|
mutation 'self.proc { }'
|
|
|
|
mutation 'custom.proc { raise }'
|
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'proc { }'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'proc'
|
|
|
|
mutation 'proc { raise }'
|
2016-10-10 01:24:22 -04:00
|
|
|
mutation 'lambda { }'
|
2016-10-10 01:09:49 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
Mutant::Meta::Example.add :send do
|
|
|
|
source 'Proc.new { }'
|
|
|
|
|
|
|
|
singleton_mutations
|
|
|
|
mutation 'Proc.new'
|
|
|
|
mutation 'self.new { }'
|
|
|
|
mutation 'Proc.new { raise }'
|
2016-10-10 01:24:22 -04:00
|
|
|
mutation 'lambda { }'
|
2016-10-10 01:09:49 -04:00
|
|
|
end
|