Simplify float literal mutator

* Adjust flay score
This commit is contained in:
Markus Schirp 2012-08-15 21:03:54 +02:00
parent 35841bded2
commit 45d47add08
2 changed files with 14 additions and 4 deletions

View file

@ -1,2 +1,2 @@
--- ---
threshold: 15.6 threshold: 14.4

View file

@ -15,12 +15,22 @@ module Mutant
def dispatch def dispatch
emit_nil emit_nil
emit_values(values) emit_values(values)
emit_safe(infinity) emit_special_cases
emit_safe(negative_infinity)
emit_safe(nan)
emit_new { new_self(Random.float) } emit_new { new_self(Random.float) }
end end
# Emit special cases
#
# @return [undefined]
#
# @api private
#
def emit_special_cases
[infinity, negative_infinity, nan].each do |value|
emit_safe(value)
end
end
# Return values to test against # Return values to test against
# #
# @return [Array] # @return [Array]