summaryrefslogtreecommitdiff
path: root/test/yaml/test_yaml.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-10-08 22:50:50 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-10-08 22:50:50 -0700
commit5ffa4a8bdb7e541a6cfa0e26d634ca3a7adc1339 (patch)
treea00a689a7992a0e407bb8c9b1ed89c33cf5426df /test/yaml/test_yaml.rb
parent34b588f382e297ee80ddfef084923b4fc7bfc7b9 (diff)
downloadpsych-5ffa4a8bdb7e541a6cfa0e26d634ca3a7adc1339.zip
updating yaml test
Diffstat (limited to 'test/yaml/test_yaml.rb')
-rw-r--r--test/yaml/test_yaml.rb81
1 files changed, 45 insertions, 36 deletions
diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb
index b8ddd12..bdc83aa 100644
--- a/test/yaml/test_yaml.rb
+++ b/test/yaml/test_yaml.rb
@@ -716,23 +716,32 @@ EOY
assert_equal( doc_ct, 2 )
end
- def test_spec_url_escaping
- YAML.add_domain_type( "domain.tld,2002", "type0" ) { |type, val|
- "ONE: #{val}"
- }
- YAML.add_domain_type( "domain.tld,2002", "type%30" ) { |type, val|
- "TWO: #{val}"
- }
- assert_parse_only(
- { 'same' => [ 'ONE: value', 'ONE: value' ], 'different' => [ 'TWO: value' ] }, <<EOY
-same:
- - !domain.tld,2002/type\\x30 value
- - !domain.tld,2002/type0 value
-different: # As far as the YAML parser is concerned
- - !domain.tld,2002/type%30 value
-EOY
- )
- end
+ ###
+ # Commenting out this test. This line:
+ #
+ # - !domain.tld,2002/type\\x30 value
+ #
+ # Is invalid according to the YAML spec:
+ #
+ # http://yaml.org/spec/1.1/#id896876
+ #
+# def test_spec_url_escaping
+# YAML.add_domain_type( "domain.tld,2002", "type0" ) { |type, val|
+# "ONE: #{val}"
+# }
+# YAML.add_domain_type( "domain.tld,2002", "type%30" ) { |type, val|
+# "TWO: #{val}"
+# }
+# assert_parse_only(
+# { 'same' => [ 'ONE: value', 'ONE: value' ], 'different' => [ 'TWO: value' ] }, <<EOY
+#same:
+# - !domain.tld,2002/type\\x30 value
+# - !domain.tld,2002/type0 value
+#different: # As far as the YAML parser is concerned
+# - !domain.tld,2002/type%30 value
+#EOY
+# )
+# end
def test_spec_override_anchor
# Override anchor
@@ -1141,24 +1150,24 @@ EOY
)
end
- #
- # Test the YAML::Stream class -- INACTIVE at the moment
- #
- def test_document
- y = YAML::Stream.new( :Indent => 2, :UseVersion => 0 )
- y.add(
- { 'hi' => 'hello', 'map' =>
- { 'good' => 'two' },
- 'time' => Time.now,
- 'try' => /^po(.*)$/,
- 'bye' => 'goodbye'
- }
- )
- y.add( { 'po' => 'nil', 'oper' => 90 } )
- y.add( { 'hi' => 'wow!', 'bye' => 'wow!' } )
- y.add( { [ 'Red Socks', 'Boston' ] => [ 'One', 'Two', 'Three' ] } )
- y.add( [ true, false, false ] )
- end
+ ##
+ ## Test the YAML::Stream class -- INACTIVE at the moment
+ ##
+ #def test_document
+ # y = YAML::Stream.new( :Indent => 2, :UseVersion => 0 )
+ # y.add(
+ # { 'hi' => 'hello', 'map' =>
+ # { 'good' => 'two' },
+ # 'time' => Time.now,
+ # 'try' => /^po(.*)$/,
+ # 'bye' => 'goodbye'
+ # }
+ # )
+ # y.add( { 'po' => 'nil', 'oper' => 90 } )
+ # y.add( { 'hi' => 'wow!', 'bye' => 'wow!' } )
+ # y.add( { [ 'Red Socks', 'Boston' ] => [ 'One', 'Two', 'Three' ] } )
+ # y.add( [ true, false, false ] )
+ #end
#
# Test YPath choices parsing
@@ -1215,7 +1224,7 @@ EOY
#
# From Minero Aoki [ruby-core:2305]
#
- require 'yaml'
+ #require 'yaml'
t = Time.now
t = Time.at(t.tv_sec, t.tv_usec)
5.times do