зеркало из https://github.com/github/ruby.git
* test/date/test_date_base.rb: don't use no message skip().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
512624b628
Коммит
674a33edf5
|
@ -1,3 +1,7 @@
|
|||
Wed May 4 22:08:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* test/date/test_date_base.rb: don't use no message skip().
|
||||
|
||||
Wed May 4 21:11:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* benchmark/bm_io_select2.rb: reduce number of using file
|
||||
|
|
|
@ -53,7 +53,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_ordinal__julian
|
||||
skip unless defined?(Calendar)
|
||||
return unless defined?(Calendar)
|
||||
for j in @from..@to
|
||||
m, d, y = julian_from_absolute(absolute_from_julian_day_number(j))
|
||||
j0 = julian_day_number_from_absolute(absolute_from_julian(12, 31, y - 1))
|
||||
|
@ -68,7 +68,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_ordinal__gregorian
|
||||
skip unless defined?(Calendar)
|
||||
return unless defined?(Calendar)
|
||||
for j in @from..@to
|
||||
m, d, y = gregorian_from_absolute(absolute_from_julian_day_number(j))
|
||||
j0 =
|
||||
|
@ -84,7 +84,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_civil__julian
|
||||
skip unless defined?(Calendar)
|
||||
return unless defined?(Calendar)
|
||||
for j in @from..@to
|
||||
m, d, y = julian_from_absolute(absolute_from_julian_day_number(j))
|
||||
j2 = julian_day_number_from_absolute(absolute_from_julian(m, d, y))
|
||||
|
@ -99,7 +99,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_civil__gregorian
|
||||
skip unless defined?(Calendar)
|
||||
return unless defined?(Calendar)
|
||||
for j in @from..@to
|
||||
m, d, y = gregorian_from_absolute(absolute_from_julian_day_number(j))
|
||||
j2 = julian_day_number_from_absolute(absolute_from_gregorian(m, d, y))
|
||||
|
@ -114,7 +114,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_commercial__gregorian
|
||||
skip unless defined?(Calendar)
|
||||
return unless defined?(Calendar)
|
||||
for j in @from..@to
|
||||
w, d, y = iso_from_absolute(absolute_from_julian_day_number(j))
|
||||
j2 = julian_day_number_from_absolute(absolute_from_iso(w, d, y))
|
||||
|
@ -129,7 +129,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_weeknum
|
||||
skip unless defined?(Calendar)
|
||||
return unless defined?(Calendar)
|
||||
for j in @from..@to
|
||||
for k in 0..1
|
||||
wy, ww, wd = Date.__send__(:jd_to_weeknum, j, k, Date::GREGORIAN)
|
||||
|
@ -140,7 +140,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_weeknum__2
|
||||
skip unless defined?(Calendar)
|
||||
return unless defined?(Calendar)
|
||||
for j in @from4t..@to4t
|
||||
d = Date.jd(j)
|
||||
t = Time.mktime(d.year, d.mon, d.mday)
|
||||
|
@ -158,8 +158,8 @@ class TestDateBase < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_nth_kday
|
||||
skip unless defined?(Calendar)
|
||||
skip unless (Date.respond_to?(:nth_kday_to_jd, true) &&
|
||||
return unless defined?(Calendar)
|
||||
return unless (Date.respond_to?(:nth_kday_to_jd, true) &&
|
||||
Date.respond_to?(:jd_to_nth_kday, true))
|
||||
for y in 1601..2401
|
||||
for m in 1..12
|
||||
|
@ -221,7 +221,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_jd
|
||||
valid_jd_p = :_valid_jd?
|
||||
skip unless Date.respond_to?(valid_jd_p, true)
|
||||
return unless Date.respond_to?(valid_jd_p, true)
|
||||
assert_equal(-1, Date.__send__(valid_jd_p, -1))
|
||||
assert_equal(0, Date.__send__(valid_jd_p, 0))
|
||||
assert_equal(1, Date.__send__(valid_jd_p, 1))
|
||||
|
@ -230,7 +230,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_ordinal
|
||||
valid_ordinal_p = :_valid_ordinal?
|
||||
skip unless Date.respond_to?(valid_ordinal_p, true)
|
||||
return unless Date.respond_to?(valid_ordinal_p, true)
|
||||
assert_nil(Date.__send__(valid_ordinal_p, 1999,366))
|
||||
assert_equal(2451910, Date.__send__(valid_ordinal_p, 2000,366))
|
||||
assert_nil(Date.__send__(valid_ordinal_p, 1999,-366))
|
||||
|
@ -245,7 +245,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_ordinal__edge
|
||||
valid_ordinal_p = :_valid_ordinal?
|
||||
skip unless Date.respond_to?(valid_ordinal_p, true)
|
||||
return unless Date.respond_to?(valid_ordinal_p, true)
|
||||
(1601..2400).each do |y|
|
||||
d = if Date.leap?(y) then 366 else 365 end
|
||||
assert_not_nil(Date.__send__(valid_ordinal_p, y,d))
|
||||
|
@ -271,7 +271,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_ordinal__italy
|
||||
valid_ordinal_p = :_valid_ordinal?
|
||||
skip unless Date.respond_to?(valid_ordinal_p, true)
|
||||
return unless Date.respond_to?(valid_ordinal_p, true)
|
||||
(1..355).each do |d|
|
||||
assert_not_nil(Date.__send__(valid_ordinal_p, 1582,d,Date::ITALY))
|
||||
end
|
||||
|
@ -288,7 +288,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_ordinal__england
|
||||
valid_ordinal_p = :_valid_ordinal?
|
||||
skip unless Date.respond_to?(valid_ordinal_p, true)
|
||||
return unless Date.respond_to?(valid_ordinal_p, true)
|
||||
(1..355).each do |d|
|
||||
assert_not_nil(Date.__send__(valid_ordinal_p, 1752,d,Date::ENGLAND))
|
||||
end
|
||||
|
@ -299,7 +299,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_civil
|
||||
valid_civil_p = :_valid_civil?
|
||||
skip unless Date.respond_to?(valid_civil_p, true)
|
||||
return unless Date.respond_to?(valid_civil_p, true)
|
||||
assert_nil(Date.__send__(valid_civil_p, 1999,2,29))
|
||||
assert_equal(2451604, Date.__send__(valid_civil_p, 2000,2,29))
|
||||
assert_nil(Date.__send__(valid_civil_p, 1999,2,-29))
|
||||
|
@ -315,7 +315,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_civil__edge
|
||||
valid_civil_p = :_valid_civil?
|
||||
skip unless Date.respond_to?(valid_civil_p, true)
|
||||
return unless Date.respond_to?(valid_civil_p, true)
|
||||
(1601..2400).each do |y|
|
||||
d = if Date.leap?(y) then 29 else 28 end
|
||||
assert_not_nil(Date.__send__(valid_civil_p, y,2,d))
|
||||
|
@ -334,7 +334,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_civil__italy
|
||||
valid_civil_p = :_valid_civil?
|
||||
skip unless Date.respond_to?(valid_civil_p, true)
|
||||
return unless Date.respond_to?(valid_civil_p, true)
|
||||
(1..4).each do |d|
|
||||
assert_not_nil(Date.__send__(valid_civil_p, 1582,10,d,Date::ITALY))
|
||||
end
|
||||
|
@ -363,7 +363,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_civil__england
|
||||
valid_civil_p = :_valid_civil?
|
||||
skip unless Date.respond_to?(valid_civil_p, true)
|
||||
return unless Date.respond_to?(valid_civil_p, true)
|
||||
(1..2).each do |d|
|
||||
assert_not_nil(Date.__send__(valid_civil_p, 1752,9,d,Date::ENGLAND))
|
||||
end
|
||||
|
@ -386,7 +386,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_commercial
|
||||
valid_commercial_p = :_valid_commercial?
|
||||
skip unless Date.respond_to?(valid_commercial_p, true)
|
||||
return unless Date.respond_to?(valid_commercial_p, true)
|
||||
assert_nil(Date.__send__(valid_commercial_p, 1999,53,1))
|
||||
assert_equal(2453367, Date.__send__(valid_commercial_p, 2004,53,1))
|
||||
assert_nil(Date.__send__(valid_commercial_p, 1999,-53,-1))
|
||||
|
@ -396,7 +396,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_weeknum
|
||||
valid_weeknum_p = :_valid_weeknum?
|
||||
skip unless Date.respond_to?(valid_weeknum_p, true)
|
||||
return unless Date.respond_to?(valid_weeknum_p, true)
|
||||
assert_nil(Date.__send__(valid_weeknum_p, 1999,53,0, 0))
|
||||
assert_equal(2454101, Date.__send__(valid_weeknum_p, 2006,53,0, 0))
|
||||
assert_nil(Date.__send__(valid_weeknum_p, 1999,-53,-1, 0))
|
||||
|
@ -411,7 +411,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_nth_kday
|
||||
valid_nth_kday_p = :_valid_nth_kday?
|
||||
skip unless Date.respond_to?(valid_nth_kday_p, true)
|
||||
return unless Date.respond_to?(valid_nth_kday_p, true)
|
||||
assert_nil(Date.__send__(valid_nth_kday_p, 1992,2, 5,0))
|
||||
assert_equal(2448682, Date.__send__(valid_nth_kday_p, 1992,2, 5,6))
|
||||
assert_equal(2448682, Date.__send__(valid_nth_kday_p, 1992,2, 5,-1))
|
||||
|
@ -421,7 +421,7 @@ class TestDateBase < Test::Unit::TestCase
|
|||
|
||||
def test_valid_time
|
||||
valid_time_p = :_valid_time?
|
||||
skip unless Date.respond_to?(valid_time_p, true)
|
||||
return unless Date.respond_to?(valid_time_p, true)
|
||||
assert_equal(Rational(0), DateTime.__send__(valid_time_p, 0,0,0))
|
||||
assert_nil(DateTime.__send__(valid_time_p, 25,59,59))
|
||||
assert_nil(DateTime.__send__(valid_time_p, 23,60,59))
|
||||
|
|
Загрузка…
Ссылка в новой задаче