diff --git a/lib/mutant/node_helpers.rb b/lib/mutant/node_helpers.rb index 183f0afb..63043297 100644 --- a/lib/mutant/node_helpers.rb +++ b/lib/mutant/node_helpers.rb @@ -15,9 +15,9 @@ module Mutant end module_function :s - NAN = s(:send, s(:float, 0.0), :/, s(:args, s(:float, 0.0))) - NEGATIVE_INFINITY = s(:send, s(:float, -1.0), :/, s(:args, s(:float, 0.0))) - INFINITY = s(:send, s(:float, 1.0), :/, s(:args, s(:float, 0.0))) + NAN = s(:begin, s(:send, s(:float, 0.0), :/, s(:args, s(:float, 0.0)))) + NEGATIVE_INFINITY = s(:begin, s(:send, s(:float, -1.0), :/, s(:args, s(:float, 0.0)))) + INFINITY = s(:begin, s(:send, s(:float, 1.0), :/, s(:args, s(:float, 0.0)))) NEW_OBJECT = s(:send, s(:const, s(:cbase), :Object), :new) RAISE = s(:send, nil, :raise) diff --git a/spec/unit/mutant/mutator/node/literal/range_spec.rb b/spec/unit/mutant/mutator/node/literal/range_spec.rb index c89f9b41..5fc40037 100644 --- a/spec/unit/mutant/mutator/node/literal/range_spec.rb +++ b/spec/unit/mutant/mutator/node/literal/range_spec.rb @@ -8,10 +8,10 @@ describe Mutant::Mutator::Node::Literal, 'range' do mutations = [] mutations << 'nil' mutations << '1...100' - mutations << '(0.0/0.0)..100' + mutations << '(0.0 / 0.0)..100' #mutations << [:dot2, [:negate, [:call, [:lit, 1.0], :/, [:arglist, [:lit, 0.0]]]], [:lit, 100]] - mutations << '1..(1.0/0.0)' - mutations << '1..(0.0/0.0)' + mutations << '1..(1.0 / 0.0)' + mutations << '1..(0.0 / 0.0)' end it_should_behave_like 'a mutator' @@ -24,10 +24,10 @@ describe Mutant::Mutator::Node::Literal, 'range' do mutations = [] mutations << 'nil' mutations << '1..100' - mutations << '(0.0/0.0)...100' + mutations << '(0.0 / 0.0)...100' #mutations << [:dot3, [:negate, [:call, [:lit, 1.0], :/, [:arglist, [:lit, 0.0]]]], [:lit, 100]] - mutations << '1...(1.0/0.0)' - mutations << '1...(0.0/0.0)' + mutations << '1...(1.0 / 0.0)' + mutations << '1...(0.0 / 0.0)' end it_should_behave_like 'a mutator'