mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 09:31:20 +08:00
add core/float/{<, <=, >, >=} specs
This commit is contained in:
7
test/test-android/app/core/float/gt_spec.rb
Normal file
7
test/test-android/app/core/float/gt_spec.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
describe "Float#>" do
|
||||
it "returns true if self is greater than other" do
|
||||
(1.5 > 1).should == true
|
||||
(2.5 > 3).should == false
|
||||
(45.91 > bignum_value).should == false
|
||||
end
|
||||
end
|
||||
7
test/test-android/app/core/float/gte_spec.rb
Normal file
7
test/test-android/app/core/float/gte_spec.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
describe "Float#>=" do
|
||||
it "returns true if self is greater than or equal to other" do
|
||||
(5.2 >= 5.2).should == true
|
||||
(9.71 >= 1).should == true
|
||||
(5.55382 >= 0xfabdafbafcab).should == false
|
||||
end
|
||||
end
|
||||
7
test/test-android/app/core/float/lt_spec.rb
Normal file
7
test/test-android/app/core/float/lt_spec.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
describe "Float#<" do
|
||||
it "returns true if self is less than other" do
|
||||
(71.3 < 91.8).should == true
|
||||
(192.6 < -500).should == false
|
||||
(-0.12 < 0x4fffffff).should == true
|
||||
end
|
||||
end
|
||||
8
test/test-android/app/core/float/lte_spec.rb
Normal file
8
test/test-android/app/core/float/lte_spec.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
describe "Float#<=" do
|
||||
it "returns true if self is less than or equal to other" do
|
||||
(2.0 <= 3.14159).should == true
|
||||
(-2.7183 <= -24).should == false
|
||||
(0.0 <= 0.0).should == true
|
||||
(9_235.9 <= bignum_value).should == true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user