aboutsummaryrefslogtreecommitdiffstats
path: root/test/date
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/date] Make Ractor-compatibleMarc-Andre Lafortune2020-12-221-0/+27
|
* [ruby/date] Fix cannot load complex into simple error when loading marshal ↵Jeremy Evans2020-06-201-0/+7
| | | | | | | | | | | | | | | dump (Fixes #20) This problem exists because Marshal.load calls Date.allocate, which uses a SimpleDateData. There doesn't seem to be any support for taking an existing Date instance and converting it from SimpleDateData to ComplexDateData. Work around this issue by making Date.allocate use a ComplexDateData. This causes problems in Date#initialize, so remove the Date#initialize method (keeping the date_initialize function, used internally for Date.civil). Alias Date.new to Date.civil, since they do the same thing. https://github.com/ruby/date/commit/6bb8d8fa0f
* Fixed misspellingsNobuyoshi Nakada2019-12-201-1/+1
| | | | Fixed misspellings reported at [Bug #16437], for default gems.
* [ruby/date] Add more timezone abbreviationsJeremy Evans2019-11-011-0/+1
| | | | | | | | | | | | | | | | This gets the time zone abbreviations from https://www.timeanddate.com/time/zones/, and adds unambiguous time zones not already present in zonetab.list. See bin/update-abbr for the program used. This regenerates zonetab.h using prereq.mk (requires gperf). Only one test line is added, just to make sure a new time zone abbreviation is picked up. Fixes Ruby Bug 16286 https://github.com/ruby/date/commit/702e8b3033
* [ruby/date] Revert "Simplify #inspect"Jeremy Evans2019-10-311-2/+0
| | | | | | | | This reverts commit af01edd7d8575f544f647dbe8cde5b6ae535d459. Revert requested by Yui Naruse. https://github.com/ruby/date/commit/875d563557
* [ruby/date] introduce Date::Error, raise Date::Error for everyglaszig2019-10-313-27/+39
| | | | | | "invalid <anything>" type of exception https://github.com/ruby/date/commit/3e55c09ba4
* Fix typo causing Date.new(year, month) to failJeremy Evans2019-10-241-0/+4
| | | | Add a test for this case.
* [ruby/date] Simplify #inspectzverok2019-10-241-0/+2
| | | | https://github.com/ruby/date/commit/af01edd7d8
* [ruby/date] Remove taint supportJeremy Evans2019-10-242-31/+1
| | | | | | | | Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous versions. https://github.com/ruby/date/commit/519470dc3b
* [ruby/date] Support -Float::INFINITY...date rangesJeremy Evans2019-10-241-0/+13
| | | | | | Fixes Ruby Bug 12961 https://github.com/ruby/date/commit/7f533c2552
* [ruby/date] Check for numeric arguments in constructorsJeremy Evans2019-10-241-0/+50
| | | | | | | | | | | | | | | Previously, the type of these arguments were not checked, leading to NoMethodErrors in some cases, and TypeErrors in other cases, but not showing what field was having the problems. This change makes it so the field with the problem is included in the error message. For the valid_*? methods, this changes them to return false if one of the arguments that should be numeric is not. Fixes Ruby Bug 11935 Fixes Ruby Misc 15298 https://github.com/ruby/date/commit/a2f4b665f8
* [ruby/date] Make julian dates roundtrip through to_time.to_dateJeremy Evans2019-10-241-0/+18
| | | | | | | | | | | | | | | Previously, julian dates would not round trip through to_time.to_date, because Time is always considered gregorian. This converts the Date instance from julian to gregorian before converting to Time, ensuring that an equal date object will be returned if converting that Time back to Date. This does result in julian Date objects showing different day values if converting to Time. Fixes Ruby Bug 8428. https://github.com/ruby/date/commit/d8df64555e
* date_parse.c: avoid copyingNobuyoshi Nakada2019-08-121-1/+2
| | | | | * ext/date/date_parse.c (date_zone_to_diff): get rid of copying the whole argument string.
* Fix Date#step testNobuyoshi Nakada2019-08-071-2/+4
| | | | The document states that "the limit should be a date object".
* Test invalid offset warningsNobuyoshi Nakada2019-07-241-3/+6
|
* Allow mday in Date.iso8601 to be omittedNobuyoshi Nakada2019-07-161-0/+3
| | | | [Bug #12285]
* suppress marshal warningsNobuyoshi Nakada2019-06-041-2/+10
|
* date: support for Reiwa, new Japanese eranobu2019-04-092-0/+26
| | | | | | [Feature #15742] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* date: make zone a substring to copy encoding and taintednessnobu2019-04-031-1/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Added tests for end of Heiseinobu2019-04-012-1/+64
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/date: removed unnecessaruy `__send__`nobu2018-12-112-22/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* date_core.c: moved some methods to DateTimenobu2018-12-111-11/+5
| | | | | | | | * ext/date/date_core.c (Init_date_core): moved methods which make sense only for DateTime to that class, instead of defining private methods in Date and making them public in DateTime. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* date_core.c: respect COMPLEX_DAT bitnobu2018-11-131-0/+8
| | | | | | | * ext/date/date_core.c (d_lite_marshal_load): respect COMPLEX_DAT bit in the pre-allocated structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* date_core.c: keep COMPLEX_DAT bitnobu2018-11-131-0/+8
| | | | | | | | * ext/date/date_core.c (d_lite_initialize_copy): do not change COMPLEX_DAT bit, as the structure does not change. initialize member-wise instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Support old versions of Ruby with FrozenError.hsbt2018-08-071-2/+4
| | | | | | They should work separatedly from Ruby core repository. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/date/test_date_base.rb: removedmame2018-04-171-435/+0
| | | | | | It depends upon calendar.so which is not bundled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* date_core.c: check conversionnobu2018-03-071-0/+14
| | | | | | | * ext/date/date_core.c (offset_to_sec, d_lite_plus): check conversion results, to get rid of infinite recursion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_date_arith.rb: needs `test_` prefixnobu2018-03-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* date_core.c: defensive codenobu2018-02-251-0/+13
| | | | | | | | | * ext/date/date_core.c (f_cmp): check comparison failure. * ext/date/date_core.c (d_lite_step): deal with the comparison result more defensively. [ruby-core:85796] [Bug #14549] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add FrozenError as a subclass of RuntimeErrorshyouhei2017-12-121-2/+2
| | | | | | | | | | | | | | FrozenError will be used instead of RuntimeError for exceptions raised when there is an attempt to modify a frozen object. The reason for this change is to differentiate exceptions related to frozen objects from generic exceptions such as those generated by Kernel#raise without an exception class. From: Jeremy Evans <code@jeremyevans.net> Signed-off-by: Urabe Shyouhei <shyouhei@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Do not define test method instead of skip when Calendar class is not defined.hsbt2017-11-104-17/+5
| | | | | | | Revisit r34739. Patch by MSP-Greg. [Bug #14088][ruby-core:83690][fix GH-1743] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: unnormalized Fixnum valuenobu2017-09-071-0/+2
| | | | | | | * include/ruby/ruby.h (ST2FIX): fix unnormalized Fixnum value bug on mingw/mswin. [ruby-core:82687] [Bug #13877] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* {ext,test}/date: Specify frozen_string_literal: true.kazu2017-01-2712-28/+28
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* date_strftime.c: check precisionnobu2016-06-141-0/+8
| | | | | | | | * ext/date/date_strftime.c (date_strftime_with_tmx): reject too large precision to get rid of buffer overflow. reported by Guido Vranken <guido AT guidovranken.nl>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use Integer instead of Fixnum and Bignum.akr2016-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c, lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb, lib/rubygems/specification.rb, lib/uri/generic.rb, bootstraptest/test_eval.rb, basictest/test.rb, test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb, test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb, test/csv/test_data_converters.rb, test/date/test_date.rb, test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb, test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb, test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb, test/ruby/test_bignum.rb, test/ruby/test_case.rb, test/ruby/test_class.rb, test/ruby/test_complex.rb, test/ruby/test_enum.rb, test/ruby/test_eval.rb, test/ruby/test_iseq.rb, test/ruby/test_literal.rb, test/ruby/test_math.rb, test/ruby/test_module.rb, test/ruby/test_numeric.rb, test/ruby/test_range.rb, test/ruby/test_rational.rb, test/ruby/test_refinement.rb, test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb, test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb, test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* date_core.c: preserve timezonenobu2016-04-121-0/+17
| | | | | | | * ext/date/date_core.c (time_to_time): should preserve timezone info. [ruby-core:74889] [Bug #12271] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/date/date_core.c (datetime_to_time): preserve timezone infosonots2016-03-181-5/+3
| | | | | | [Bug #12189] [Fix GH-1295] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-1612-0/+12
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_date.rb: nonsense assertionnobu2014-09-101-1/+0
| | | | | | | * test/date/test_date.rb (TestDate#test__const): remove nonsense assertion. nil.frozen? is not date's concern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/date/test_date.rb: remove commented-out code.hsbt2014-08-014-46/+0
| | | | | | | | * test/date/test_date_arith.rb: ditto. * test/date/test_date_attr.rb: ditto. * test/date/test_date_parse.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/date/test_date_arith.rb: remove unused block argument.hsbt2014-06-161-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/date/test_date_strptime.rb: remove useless variable.hsbt2014-06-161-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/date/date_core.c (rt_rewrite_frags): a new feature (not atadf2014-05-041-0/+17
| | | | | | | | | bug fix) of strptime. applies offset even if the given date is not local time (%s and %Q). This is an exceptional feature and I do NOT recommend to use this at all. Thank you git community. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/date/date_strptime.c (date__strptime_internal): do not overwrite century.tadf2014-04-271-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/date/date_core.c (d_lite_cmp): should compare with #<.tadf2014-04-051-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Additional test coverage to DateTime comparison (sub millisecond).nobu2013-12-141-0/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* date_parse.c: missing wdaynobu2013-07-211-0/+6
| | | | | | | * ext/date/date_parse.c (rfc2822_cb): check if wday is given, since it can be omitted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/date/date_parse.c (date_zone_to_diff): [ruby-core:55831].tadf2013-07-091-0/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/date/date_core.c: fixed a bug [ruby-core:55295]. reportedtadf2013-06-041-0/+53
| | | | | | | | by Riley Lynch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/date/test_date_{parse,strptime}.rb: changed the format oftadf2012-11-112-454/+453
| | | | | | | some extra messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e