diff --git a/lib/mutant/mutator/node/literal/integer.rb b/lib/mutant/mutator/node/literal/integer.rb index b3e4f25ab..c7bef2c2f 100644 --- a/lib/mutant/mutator/node/literal/integer.rb +++ b/lib/mutant/mutator/node/literal/integer.rb @@ -9,6 +9,8 @@ class Integer < self handle(:int) + children :value + private def dispatch @@ -17,12 +19,7 @@ def dispatch end def values - [0, 1, -value, value + 1, value - 1] - end - - def value - value, = children - value + [0, 1, value + 1, value - 1] end end # Integer diff --git a/meta/and_asgn.rb b/meta/and_asgn.rb index 221b61cde..1f8a34db5 100644 --- a/meta/and_asgn.rb +++ b/meta/and_asgn.rb @@ -8,6 +8,5 @@ mutation 'a__mutant__ &&= 1' mutation 'a &&= nil' mutation 'a &&= 0' - mutation 'a &&= -1' mutation 'a &&= 2' end diff --git a/meta/index.rb b/meta/index.rb index 6a8d0d54d..3953588aa 100644 --- a/meta/index.rb +++ b/meta/index.rb @@ -25,7 +25,6 @@ mutation 'self[1]' mutation 'foo[0]' mutation 'foo[2]' - mutation 'foo[-1]' mutation 'foo[nil]' end @@ -43,7 +42,6 @@ mutation 'foo[nil]' mutation 'foo[n..nil]' mutation 'foo[n..-1]' - mutation 'foo[n..2]' mutation 'foo[n..0]' mutation 'foo[n..1]' mutation 'foo[n..-3]' diff --git a/meta/int.rb b/meta/int.rb index a7b90e7f9..c1730ef6a 100644 --- a/meta/int.rb +++ b/meta/int.rb @@ -9,9 +9,6 @@ mutation '0' mutation '1' - # negative - mutation '-10' - # scalar boundary mutation '9' mutation '11' diff --git a/meta/ivasgn.rb b/meta/ivasgn.rb index e24413579..679ba0223 100644 --- a/meta/ivasgn.rb +++ b/meta/ivasgn.rb @@ -16,6 +16,5 @@ mutation '@a__mutant__ &&= 1' mutation '@a &&= nil' mutation '@a &&= 0' - mutation '@a &&= -1' mutation '@a &&= 2' end diff --git a/meta/op_assgn.rb b/meta/op_assgn.rb index d79fc726c..1a5f6702e 100644 --- a/meta/op_assgn.rb +++ b/meta/op_assgn.rb @@ -6,7 +6,6 @@ singleton_mutations mutation '@a += 1' - mutation '@a.b += -1' mutation '@a.b += 0' mutation '@a.b += 2' mutation '@a.b += nil' @@ -19,7 +18,6 @@ singleton_mutations - mutation 'a.b += -1' mutation 'a.b += 0' mutation 'a.b += 2' mutation 'a.b += nil' @@ -32,7 +30,6 @@ singleton_mutations mutation 'b__mutant__ += 1' - mutation 'b += -1' mutation 'b += 0' mutation 'b += 2' mutation 'b += nil' diff --git a/meta/or_asgn.rb b/meta/or_asgn.rb index bd88e72fa..cc2805f18 100644 --- a/meta/or_asgn.rb +++ b/meta/or_asgn.rb @@ -7,7 +7,6 @@ mutation 'a__mutant__ ||= 1' mutation 'a ||= nil' mutation 'a ||= 0' - mutation 'a ||= -1' mutation 'a ||= 2' end @@ -17,7 +16,6 @@ singleton_mutations mutation '@a ||= nil' mutation '@a ||= 0' - mutation '@a ||= -1' mutation '@a ||= 2' end @@ -42,6 +40,5 @@ singleton_mutations mutation 'foo[:bar] ||= nil' mutation 'foo[:bar] ||= 0' - mutation 'foo[:bar] ||= -1' mutation 'foo[:bar] ||= 2' end diff --git a/meta/range.rb b/meta/range.rb index ba08c6abb..ccaa43a95 100644 --- a/meta/range.rb +++ b/meta/range.rb @@ -5,7 +5,6 @@ singleton_mutations mutation '1...100' - mutation '-1..100' mutation '0..100' mutation '2..100' mutation 'nil..100' @@ -14,7 +13,6 @@ mutation '1..1' mutation '1..99' mutation '1..101' - mutation '1..-100' end Mutant::Meta::Example.add :erange do @@ -22,7 +20,6 @@ singleton_mutations mutation '1..100' - mutation '-1...100' mutation '0...100' mutation '2...100' mutation 'nil...100' @@ -31,7 +28,6 @@ mutation '1...1' mutation '1...99' mutation '1...101' - mutation '1...-100' end unless RUBY_VERSION.start_with?('2.5') @@ -39,7 +35,6 @@ source '1...' singleton_mutations - mutation '-1...' mutation '0...' mutation '2...' mutation 'nil...' @@ -49,7 +44,6 @@ source '1..' singleton_mutations - mutation '-1..' mutation '0..' mutation '2..' mutation 'nil..' diff --git a/meta/send.rb b/meta/send.rb index 988b075a4..087cacc76 100644 --- a/meta/send.rb +++ b/meta/send.rb @@ -343,7 +343,6 @@ mutation 'foo.public_send(1, two: true, **kwargs, &block)' mutation 'foo.public_send(:bar, nil, two: true, **kwargs, &block)' mutation 'foo.public_send(:bar, 0, two: true, **kwargs, &block)' - mutation 'foo.public_send(:bar, -1, two: true, **kwargs, &block)' mutation 'foo.public_send(:bar, 2, two: true, **kwargs, &block)' mutation 'foo.public_send(:bar, two: true, **kwargs, &block)' mutation 'foo.public_send(:bar, 1, two__mutant__: true, **kwargs, &block)' @@ -738,7 +737,6 @@ mutation 'match?(/\Afoo/)' mutation 'match?(1)' mutation 'match?(/\Afoo/, nil)' - mutation 'match?(/\Afoo/, -1)' mutation 'match?(/\Afoo/, 0)' mutation 'match?(/\Afoo/, 2)' mutation 'match?'