@@ -11,7 +11,7 @@ class SerializationTest < Minitest::Test
1111 test 'should support aliases correctly' do
1212 x = { 'c' => 5 }
1313 hash = { 'a' => x , 'b' => x }
14- hash_yaml = "---\n a: &1\n c: 5\n b: *1\n "
14+ hash_yaml = + "---\n a: &1\n c: 5\n b: *1\n "
1515 assert_equal hash , load_yaml ( hash_yaml ) , 'Deserialising known YAML with an alias'
1616 assert_equal hash , load_yaml ( dump_yaml ( hash ) ) , 'Deserialising a structure with repeated objects'
1717 end
@@ -22,24 +22,24 @@ class SerializationTest < Minitest::Test
2222
2323 test 'should handle binary yaml with control chars' do
2424 # irb> "\xC2\xA1null \x00 characters \r\n suck!".to_yaml
25- yaml = "--- !binary |-\n wqFudWxsIAAgY2hhcmFjdGVycyANCiBzdWNrIQ==\n "
25+ yaml = + "--- !binary |-\n wqFudWxsIAAgY2hhcmFjdGVycyANCiBzdWNrIQ==\n "
2626 assert_equal "¡null 0x00 characters \r \n suck!" , load_yaml ( yaml )
2727
2828 # irb> {fulltext: "\xC2\xA1null \x00 characters \r\n suck!"}.to_yaml
29- yamled_hash = "---\n :fulltext: !binary |-\n wqFudWxsIAAgY2hhcmFjdGVycyANCiBzdWNrIQ==\n "
29+ yamled_hash = + "---\n :fulltext: !binary |-\n wqFudWxsIAAgY2hhcmFjdGVycyANCiBzdWNrIQ==\n "
3030 assert_equal ( { :fulltext => "¡null 0x00 characters \r \n suck!" } , load_yaml ( yamled_hash ) )
3131 end
3232
3333 # Psych doesn't always base64-encode control characters:
3434 test 'should handle non-binary yaml with control chars' do
3535 #irb> Psych.dump("control \x01 char \n whoops!")
36- chr_1_yaml = "--- ! \" control \\ x01 char \\ n whoops!\" \n "
36+ chr_1_yaml = + "--- ! \" control \\ x01 char \\ n whoops!\" \n "
3737 assert_equal "control 0x01 char \n whoops!" , load_yaml ( chr_1_yaml )
3838 end
3939
4040 test 'should handle non-binary yaml with escaped things that look like control chars' do
4141 # irb> Psych.dump(['\\x01 \\xAF \\\\xAF', "\x01 \\\x01 \x01\\\x01"])
42- escaped_yaml = "---\n - \" \\ \\ x01 \\ \\ xAF \\ \\ \\ \\ xAF\" \n - \" \\ x01 \\ \\ \\ x01 \\ x01\\ \\ \\ x01\" \n "
42+ escaped_yaml = + "---\n - \" \\ \\ x01 \\ \\ xAF \\ \\ \\ \\ xAF\" \n - \" \\ x01 \\ \\ \\ x01 \\ x01\\ \\ \\ x01\" \n "
4343 assert_equal [ '\\x01 \\xAF \\\\xAF' , '0x01 \\0x01 0x01\\0x01' ] , load_yaml ( escaped_yaml )
4444 end
4545
@@ -166,7 +166,7 @@ def assert_datetimes_with_zones
166166 end
167167
168168 def assert_syck_1_8_yaml_loads_correctly
169- yaml = "--- \n name: Dr. Doctor\000 \000 \000 \n diagnosis: \" CIN 1 \\ xE2\\ x80\\ x93 CIN 2\" \n "
169+ yaml = + "--- \n name: Dr. Doctor\000 \000 \000 \n diagnosis: \" CIN 1 \\ xE2\\ x80\\ x93 CIN 2\" \n "
170170 hash = load_yaml ( yaml )
171171
172172 # The null chars should be escaped:
@@ -187,7 +187,7 @@ def assert_syck_1_8_handles_encoding(hash)
187187
188188 def assert_yaml_coercion_behaviour
189189 # UTF-8, with an unmappable byte too:
190- yaml = "---\n fulltextreport: \" Here is \\ xE2\\ x80\\ x93 a weird \\ x9D char\" \n "
190+ yaml = + "---\n fulltextreport: \" Here is \\ xE2\\ x80\\ x93 a weird \\ x9D char\" \n "
191191
192192 # By default, we'd expect the (serialised) \x9D
193193 assert_raises ( UTF8Encoding ::UTF8CoercionError ) { load_yaml ( yaml ) }
0 commit comments