Bug #5170 ยป 0001-ext-date-date_core.c-d_new_by_frags-raise-on-non-Has.patch
ext/date/date_core.c | ||
---|---|---|
rb_warning("invalid start is ignored");
|
||
}
|
||
if (TYPE(hash) != T_HASH)
|
||
rb_raise(rb_eArgError, "invalid date");
|
||
if (NIL_P(ref_hash("jd")) &&
|
||
NIL_P(ref_hash("yday")) &&
|
||
!NIL_P(ref_hash("year")) &&
|
test/date/test_date_strptime.rb | ||
---|---|---|
assert_raise(ArgumentError) do
|
||
Date.strptime('23:55', '%H:%M')
|
||
end
|
||
assert_raise(ArgumentError) do # Bug #5170, [ruby-core:38855]
|
||
Date.strptime('01-31-2011', '%m/%d/%Y')
|
||
end
|
||
end
|
||
end
|