Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

### Added

- String literal mutations (`'foo'` -> `'foo__mutest__'`) [[#58](https://github.com/backus/mutest/pull/58/files) ([@dgollahon][])]
- Selector mutations for `[public_]method` methods (`foo.method(:to_s)` -> `foo.method(:to_str)`) [[#56](https://github.com/backus/mutest/pull/56/files) ([@dgollahon][])]
- Block-pass symbol#to_proc mutations (`foo(&:to_s)` -> `foo(&:to_str)`) [[#55](https://github.com/backus/mutest/pull/55/files) ([@dgollahon][])]
- Block-pass mutations (`foo(&method(:bar))` -> `foo(&public_method(:bar))`) [[#54](https://github.com/backus/mutest/pull/54/files) ([@dgollahon][])]
Expand Down
3 changes: 3 additions & 0 deletions lib/mutest/mutator/node/literal/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ class Literal
class String < self
handle(:str)

children :value

private

# Emit mutations
#
# @return [undefined]
def dispatch
emit_singletons
emit_type(value + Util::Symbol::POSTFIX)
end
end # String
end # Literal
Expand Down
2 changes: 0 additions & 2 deletions lib/mutest/mutator/node/literal/symbol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ class Symbol < self

children :value

PREFIX = '__mutest__'.freeze

private

# Emit mutations
Expand Down
2 changes: 2 additions & 0 deletions meta/dstr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
mutation '"foo#{bar}#{self}"'
mutation '"foo#{nil}baz"'
mutation '"foo#{self}baz"'
mutation '"foo__mutest__#{bar}baz"'
mutation '"foo#{bar}baz__mutest__"'
end
2 changes: 2 additions & 0 deletions meta/dsym.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
mutation ':"#{"foo"}#{self}#{"baz"}"'
mutation ':"#{"foo"}#{bar}#{nil}"'
mutation ':"#{"foo"}#{bar}#{self}"'
mutation ':"foo__mutest__#{bar}baz"'
mutation ':"foo#{bar}baz__mutest__"'
end
2 changes: 2 additions & 0 deletions meta/send.rb
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@
mutation 'foo.public_method(nil)'
mutation 'foo.public_method(self)'
mutation 'foo.public_method("to_int")'
mutation 'foo.public_method("to_i__mutest__")'
end

Mutest::Meta::Example.add :send do
Expand All @@ -930,6 +931,7 @@
mutation 'foo'
mutation '"to_s"'
mutation 'self.bar("to_s")'
mutation 'foo.bar("to_s__mutest__")'
mutation 'foo.bar'
mutation 'foo.bar(nil)'
mutation 'foo.bar(self)'
Expand Down
1 change: 1 addition & 0 deletions meta/str.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
source '"foo"'

singleton_mutations
mutation '"foo__mutest__"'
end