~ubuntu-branches/ubuntu/raring/ruby1.9.1/raring

« back to all changes in this revision

Viewing changes to test/ruby/test_time.rb

  • Committer: Bazaar Package Importer
  • Author(s): Daigo Moriwaki
  • Date: 2011-02-27 16:28:32 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20110227162832-7h4x31lnm3nx4i03
Tags: 1.9.2.180-1
* New upstream release.
  - (CVE-2011-1004; Closes: #615519)
  - No longer found in 1.9.2 (Closes: #509500)                                               
* debian/rules: correctly skip making rdoc for DEB_BUILD_OPTIONS="nordoc".
* debian/control: Build-Depends libncursesw5-dev as well. (Closes: #578169)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
    assert_equal(Time.utc(2000,2,10), Time.new(2000,2,9, 13,0,0, -3600*11))
20
20
    assert_equal(Time.utc(2000,2,10), Time.new(2000,2,10, 11,0,0, "+11:00"))
21
21
    assert_equal(Rational(1,2), Time.new(2000,2,10, 11,0,5.5, "+11:00").subsec)
 
22
    bug4090 = '[ruby-dev:42631]'
 
23
    tm = [2001,2,28,23,59,30]
 
24
    t = Time.new(*tm, "-12:00")
 
25
    assert_equal([2001,2,28,23,59,30,-43200], [t.year, t.month, t.mday, t.hour, t.min, t.sec, t.gmt_offset], bug4090)
22
26
  end
23
27
 
24
28
  def test_time_add()
628
632
                 t.strftime("%m/%d/%Y %l:%M:%S.%9N"))
629
633
    assert_equal("03/14/1592  6:53:58.97932384",
630
634
                 t.strftime("%m/%d/%Y %l:%M:%S.%8N"))
 
635
 
 
636
    # [ruby-core:33985]
 
637
    assert_equal("3000000000", Time.at(3000000000).strftime('%s'))
631
638
  end
632
639
 
633
640
  def test_delegate