- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-1.3.0
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-time/test/time.rb
r321 r331 11 11 12 12 assert('Time.at', '15.2.19.6.1') do 13 Time.at(1300000000.0) 13 assert_kind_of(Time, Time.at(1300000000.0)) 14 15 assert_raise(FloatDomainError) { Time.at(Float::NAN) } 16 assert_raise(FloatDomainError) { Time.at(Float::INFINITY) } 17 assert_raise(FloatDomainError) { Time.at(-Float::INFINITY) } 18 assert_raise(FloatDomainError) { Time.at(0, Float::NAN) } 19 assert_raise(FloatDomainError) { Time.at(0, Float::INFINITY) } 20 assert_raise(FloatDomainError) { Time.at(0, -Float::INFINITY) } 14 21 end 15 22 … … 38 45 t2 = t1.+(60) 39 46 40 t2.utc.asctime == "Sun Mar 13 07:07:40 UTC 2011" 47 assert_equal(t2.utc.asctime, "Sun Mar 13 07:07:40 UTC 2011") 48 49 assert_raise(FloatDomainError) { Time.at(0) + Float::NAN } 50 assert_raise(FloatDomainError) { Time.at(0) + Float::INFINITY } 51 assert_raise(FloatDomainError) { Time.at(0) + -Float::INFINITY } 41 52 end 42 53 … … 45 56 t2 = t1.-(60) 46 57 47 t2.utc.asctime == "Sun Mar 13 07:05:40 UTC 2011" 58 assert_equal(t2.utc.asctime, "Sun Mar 13 07:05:40 UTC 2011") 59 60 assert_raise(FloatDomainError) { Time.at(0) - Float::NAN } 61 assert_raise(FloatDomainError) { Time.at(0) - Float::INFINITY } 62 assert_raise(FloatDomainError) { Time.at(0) - -Float::INFINITY } 48 63 end 49 64
Note:
See TracChangeset
for help on using the changeset viewer.