Last change
on this file since 446 was 439, checked in by coas-nagasima, 4 years ago |
mrubyを2.1.1に更新
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-ruby;charset=UTF-8
|
File size:
382 bytes
|
Rev | Line | |
---|
[270] | 1 | ##
|
---|
| 2 | # Numeric(Ext) Test
|
---|
| 3 |
|
---|
| 4 | assert('Integer#div') do
|
---|
| 5 | assert_equal 52, 365.div(7)
|
---|
| 6 | end
|
---|
| 7 |
|
---|
| 8 | assert('Float#div') do
|
---|
[439] | 9 | skip unless Object.const_defined?(:Float)
|
---|
[270] | 10 | assert_float 52, 365.2425.div(7)
|
---|
| 11 | end
|
---|
[331] | 12 |
|
---|
| 13 | assert('Integer#zero?') do
|
---|
| 14 | assert_equal true, 0.zero?
|
---|
| 15 | assert_equal false, 1.zero?
|
---|
| 16 | end
|
---|
| 17 |
|
---|
| 18 | assert('Integer#nonzero?') do
|
---|
| 19 | assert_equal nil, 0.nonzero?
|
---|
| 20 | assert_equal 1000, 1000.nonzero?
|
---|
| 21 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.