From 079ff69ca0bb5fc71e2de009829ad7410f374c26 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Tue, 26 Nov 2013 21:41:48 +0000 Subject: * ext/psych/lib/psych/scalar_scanner.rb: fix support for negative years. * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto * test/psych/test_date_time.rb: test for change. Fixes: https://github.com/tenderlove/psych/issues/168 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_date_time.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/psych') diff --git a/test/psych/test_date_time.rb b/test/psych/test_date_time.rb index 91de6a4841..72150ad7db 100644 --- a/test/psych/test_date_time.rb +++ b/test/psych/test_date_time.rb @@ -3,6 +3,15 @@ require 'date' module Psych class TestDateTime < TestCase + def test_negative_year + time = Time.utc -1, 12, 16 + assert_cycle time + end + + def test_new_datetime + assert_cycle DateTime.new + end + def test_invalid_date assert_cycle "2013-10-31T10:40:07-000000000000033" end -- cgit v1.2.3