diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-09-06 15:53:46 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-09-06 15:53:46 +0900 |
| commit | 214668fccbca2db14ce57797017b34acd86d4690 (patch) | |
| tree | fbe8e9ed62f75704ae5e5581f3b4287db989aeba /test | |
| parent | 7387a0979158c50ca37884f14bad2b493d3e2f0a (diff) | |
[Feature #20707] Fix negative UTC offset conversion
In short, get rid of division and modulo of negative integers.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11561
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_time.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index cab14eb694..99ee84f247 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -1490,6 +1490,9 @@ class TestTime < Test::Unit::TestCase assert_equal("1960-12-31T23:00:00.123456Z", t.__send__(method, 6)) end + t = get_t2000.getlocal("-09:30") # Pacific/Marquesas + assert_equal("1999-12-31T14:30:00-09:30", t.__send__(method)) + assert_equal("10000-01-01T00:00:00Z", Time.utc(10000).__send__(method)) assert_equal("9999-01-01T00:00:00Z", Time.utc(9999).__send__(method)) assert_equal("0001-01-01T00:00:00Z", Time.utc(1).__send__(method)) # 1 AD |
