0001-ext-date-date_core.c-d_new_by_frags-raise-on-non-Has.patch

Eric Wong, 08/09/2011 05:51 AM

Download (1.46 KB)

View differences:

ext/date/date_core.c
4089 4089
	rb_warning("invalid start is ignored");
4090 4090
    }
4091 4091

  
4092
    if (TYPE(hash) != T_HASH)
4093
	rb_raise(rb_eArgError, "invalid date");
4094

  
4092 4095
    if (NIL_P(ref_hash("jd")) &&
4093 4096
	NIL_P(ref_hash("yday")) &&
4094 4097
	!NIL_P(ref_hash("year")) &&
test/date/test_date_strptime.rb
464 464
    assert_raise(ArgumentError) do
465 465
      Date.strptime('23:55', '%H:%M')
466 466
    end
467
    assert_raise(ArgumentError) do # Bug #5170, [ruby-core:38855]
468
      Date.strptime('01-31-2011', '%m/%d/%Y')
469
    end
467 470
  end
468 471

  
469 472
end