Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/ruby/language/numbers_spec.rb
Original file line number Diff line number Diff line change
@@ -45,6 +45,12 @@
eval('-3r').should == Rational(-3, 1)
end

it "can be an bignum literal with trailing 'r' to represent a Rational" do
eval('1111111111111111111111111111111111111111111111r').should == Rational(1111111111111111111111111111111111111111111111, 1)
eval('-1111111111111111111111111111111111111111111111r').should == Rational(-1111111111111111111111111111111111111111111111, 1)
end


it "can be a decimal literal with trailing 'r' to represent a Rational" do
eval('0.3r').should == Rational(3, 10)
eval('-0.3r').should == Rational(-3, 10)

0 comments on commit e018121

Please sign in to comment.