Index: EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-time/test/time.rb
===================================================================
--- EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-time/test/time.rb	(revision 331)
+++ EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-time/test/time.rb	(revision 439)
@@ -3,9 +3,9 @@
 
 assert('Time.new', '15.2.3.3.3') do
-  Time.new.class == Time
+  assert_equal(Time, Time.new.class)
 end
 
 assert('Time', '15.2.19') do
-  Time.class == Class
+  assert_equal(Class, Time.class)
 end
 
@@ -22,21 +22,49 @@
 
 assert('Time.gm', '15.2.19.6.2') do
-  Time.gm(2012, 12, 23)
+  t = Time.gm(2012, 9, 23)
+  assert_operator(2012, :eql?, t.year)
+  assert_operator(   9, :eql?, t.month)
+  assert_operator(  23, :eql?, t.day)
+  assert_operator(   0, :eql?, t.hour)
+  assert_operator(   0, :eql?, t.min)
+  assert_operator(   0, :eql?, t.sec)
+  assert_operator(   0, :eql?, t.usec)
 end
 
 assert('Time.local', '15.2.19.6.3') do
-  Time.local(2012, 12, 23)
+  t = Time.local(2014, 12, 27, 18)
+  assert_operator(2014, :eql?, t.year)
+  assert_operator(  12, :eql?, t.month)
+  assert_operator(  27, :eql?, t.day)
+  assert_operator(  18, :eql?, t.hour)
+  assert_operator(   0, :eql?, t.min)
+  assert_operator(   0, :eql?, t.sec)
+  assert_operator(   0, :eql?, t.usec)
 end
 
 assert('Time.mktime', '15.2.19.6.4') do
-  Time.mktime(2012, 12, 23)
+  t = Time.mktime(2013, 10, 4, 6, 15, 58, 3485)
+  assert_operator(2013, :eql?, t.year)
+  assert_operator(  10, :eql?, t.month)
+  assert_operator(   4, :eql?, t.day)
+  assert_operator(   6, :eql?, t.hour)
+  assert_operator(  15, :eql?, t.min)
+  assert_operator(  58, :eql?, t.sec)
+  assert_operator(3485, :eql?, t.usec)
 end
 
 assert('Time.now', '15.2.19.6.5') do
-  Time.now.class == Time
+  assert_equal(Time, Time.now.class)
 end
 
 assert('Time.utc', '15.2.19.6.6') do
-  Time.utc(2012, 12, 23)
+  t = Time.utc(2034)
+  assert_operator(2034, :eql?, t.year)
+  assert_operator(   1, :eql?, t.month)
+  assert_operator(   1, :eql?, t.day)
+  assert_operator(   0, :eql?, t.hour)
+  assert_operator(   0, :eql?, t.min)
+  assert_operator(   0, :eql?, t.sec)
+  assert_operator(   0, :eql?, t.usec)
 end
 
@@ -45,5 +73,5 @@
   t2 = t1.+(60)
 
-  assert_equal(t2.utc.asctime, "Sun Mar 13 07:07:40 UTC 2011")
+  assert_equal("Sun Mar 13 07:07:40 2011", t2.utc.asctime)
 
   assert_raise(FloatDomainError) { Time.at(0) + Float::NAN }
@@ -56,5 +84,5 @@
   t2 = t1.-(60)
 
-  assert_equal(t2.utc.asctime, "Sun Mar 13 07:05:40 UTC 2011")
+  assert_equal("Sun Mar 13 07:05:40 2011", t2.utc.asctime)
 
   assert_raise(FloatDomainError) { Time.at(0) - Float::NAN }
@@ -68,28 +96,28 @@
   t3 = Time.at(1500000000.0)
 
-  t2.<=>(t1) == 1 and
-    t2.<=>(t2) == 0 and
-    t2.<=>(t3) == -1 and
-    t2.<=>(nil) == nil
+  assert_equal(1, t2 <=> t1)
+  assert_equal(0, t2 <=> t2)
+  assert_equal(-1, t2 <=> t3)
+  assert_nil(t2 <=> nil)
 end
 
 assert('Time#asctime', '15.2.19.7.4') do
-  Time.at(1300000000.0).utc.asctime == "Sun Mar 13 07:06:40 UTC 2011"
+  assert_equal("Thu Mar  4 05:06:07 1982", Time.gm(1982,3,4,5,6,7).asctime)
 end
 
 assert('Time#ctime', '15.2.19.7.5') do
-  Time.at(1300000000.0).utc.ctime == "Sun Mar 13 07:06:40 UTC 2011"
+  assert_equal("Thu Oct 24 15:26:47 2013", Time.gm(2013,10,24,15,26,47).ctime)
 end
 
 assert('Time#day', '15.2.19.7.6') do
-  Time.gm(2012, 12, 23).day == 23
+  assert_equal(23, Time.gm(2012, 12, 23).day)
 end
 
 assert('Time#dst?', '15.2.19.7.7') do
-  not Time.gm(2012, 12, 23).utc.dst?
+  assert_not_predicate(Time.gm(2012, 12, 23).utc, :dst?)
 end
 
 assert('Time#getgm', '15.2.19.7.8') do
-  Time.at(1300000000.0).getgm.asctime == "Sun Mar 13 07:06:40 UTC 2011"
+  assert_equal("Sun Mar 13 07:06:40 2011", Time.at(1300000000.0).getgm.asctime)
 end
 
@@ -99,13 +127,14 @@
   t3 = t1.getlocal
 
-  t1 == t3 and t3 == t2.getlocal
+  assert_equal(t1, t3)
+  assert_equal(t3, t2.getlocal)
 end
 
 assert('Time#getutc', '15.2.19.7.10') do
-  Time.at(1300000000.0).getutc.asctime == "Sun Mar 13 07:06:40 UTC 2011"
+  assert_equal("Sun Mar 13 07:06:40 2011", Time.at(1300000000.0).getutc.asctime)
 end
 
 assert('Time#gmt?', '15.2.19.7.11') do
-  Time.at(1300000000.0).utc.gmt?
+  assert_predicate(Time.at(1300000000.0).utc, :gmt?)
 end
 
@@ -114,5 +143,7 @@
 
 assert('Time#gmtime', '15.2.19.7.13') do
-  Time.at(1300000000.0).gmtime
+  t = Time.now
+  assert_predicate(t.gmtime, :gmt?)
+  assert_predicate(t, :gmt?)
 end
 
@@ -121,5 +152,5 @@
 
 assert('Time#hour', '15.2.19.7.15') do
-  Time.gm(2012, 12, 23, 7, 6).hour == 7
+  assert_equal(7, Time.gm(2012, 12, 23, 7, 6).hour)
 end
 
@@ -128,54 +159,57 @@
 
 assert('Time#initialize_copy', '15.2.19.7.17') do
-  time_tmp_2 = Time.at(7.0e6)
-  time_tmp_2.clone == time_tmp_2
+  t = Time.at(7.0e6)
+  assert_equal(t, t.clone)
 end
 
 assert('Time#localtime', '15.2.19.7.18') do
-  t1 = Time.at(1300000000.0)
-  t2 = Time.at(1300000000.0)
-
-  t1.localtime
-  t1 == t2.getlocal
+  t1 = Time.utc(2014, 5 ,6)
+  t2 = Time.utc(2014, 5 ,6)
+  t3 = t2.getlocal
+
+  assert_equal(t3, t1.localtime)
+  assert_equal(t3, t1)
 end
 
 assert('Time#mday', '15.2.19.7.19') do
-  Time.gm(2012, 12, 23).mday == 23
+  assert_equal(23, Time.gm(2012, 12, 23).mday)
 end
 
 assert('Time#min', '15.2.19.7.20') do
-  Time.gm(2012, 12, 23, 7, 6).min == 6
+  assert_equal(6, Time.gm(2012, 12, 23, 7, 6).min)
 end
 
 assert('Time#mon', '15.2.19.7.21') do
-  Time.gm(2012, 12, 23).mon == 12
+  assert_equal(12, Time.gm(2012, 12, 23).mon)
 end
 
 assert('Time#month', '15.2.19.7.22') do
-  Time.gm(2012, 12, 23).month == 12
+  assert_equal(12, Time.gm(2012, 12, 23).month)
 end
 
 assert('Times#sec', '15.2.19.7.23') do
-  Time.gm(2012, 12, 23, 7, 6, 40).sec == 40
+  assert_equal(40, Time.gm(2012, 12, 23, 7, 6, 40).sec)
 end
 
 assert('Time#to_f', '15.2.19.7.24') do
-  Time.at(1300000000.0).to_f == 1300000000.0
+  assert_operator(2.0, :eql?, Time.at(2).to_f)
 end
 
 assert('Time#to_i', '15.2.19.7.25') do
-  Time.at(1300000000.0).to_i == 1300000000
+  assert_operator(2, :eql?, Time.at(2.0).to_i)
 end
 
 assert('Time#usec', '15.2.19.7.26') do
-  Time.at(1300000000.0).usec == 0
+  assert_equal(0, Time.at(1300000000.0).usec)
 end
 
 assert('Time#utc', '15.2.19.7.27') do
-  Time.at(1300000000.0).utc
+  t = Time.now
+  assert_predicate(t.utc, :gmt?)
+  assert_predicate(t, :gmt?)
 end
 
 assert('Time#utc?', '15.2.19.7.28') do
-  Time.at(1300000000.0).utc.utc?
+  assert_predicate(Time.at(1300000000.0).utc, :utc?)
 end
 
@@ -184,17 +218,17 @@
 
 assert('Time#wday', '15.2.19.7.30') do
-  Time.gm(2012, 12, 23).wday == 0
+  assert_equal(0, Time.gm(2012, 12, 23).wday)
 end
 
 assert('Time#yday', '15.2.19.7.31') do
-  Time.gm(2012, 12, 23).yday == 358
+  assert_equal(358, Time.gm(2012, 12, 23).yday)
 end
 
 assert('Time#year', '15.2.19.7.32') do
-  Time.gm(2012, 12, 23).year == 2012
+  assert_equal(2012, Time.gm(2012, 12, 23).year)
 end
 
 assert('Time#zone', '15.2.19.7.33') do
-  Time.at(1300000000.0).utc.zone == 'UTC'
+  assert_equal('UTC', Time.at(1300000000.0).utc.zone)
 end
 
@@ -202,9 +236,10 @@
 
 assert('Time#to_s') do
-  Time.at(1300000000.0).utc.to_s == "Sun Mar 13 07:06:40 UTC 2011"
+  assert_equal("2003-04-05 06:07:08 UTC", Time.gm(2003,4,5,6,7,8,9).to_s)
 end
 
 assert('Time#inspect') do
-  Time.at(1300000000.0).utc.inspect == "Sun Mar 13 07:06:40 UTC 2011"
+  assert_match("2013-10-28 16:27:48 [+-][0-9][0-9][0-9][0-9]",
+               Time.local(2013,10,28,16,27,48).inspect)
 end
 
@@ -225,4 +260,8 @@
     t += 0.0005
   end
-  t.usec == 0
-end
+  assert_equal(0, t.usec)
+end
+
+assert('Time.gm with Dec 31 23:59:59 1969 raise ArgumentError') do
+  assert_raise(ArgumentError) {Time.gm(1969, 12, 31, 23, 59, 59)}
+end
