aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/json
diff options
context:
space:
mode:
authorMaxime RETY <maximerety@macbook-de-maxime-rety.local>2010-06-14 16:05:49 +0200
committerSantiago Pastorino <santiago@wyeworks.com>2011-02-02 18:57:48 -0200
commit68e3fb81090ba67575e513407fc2463dba3b002b (patch)
tree39b1687fe614e9b57739bb6659d5e048e52151b6 /activesupport/test/json
parent8bfa8e7cbea1fb65b180260c55a7f146efbd5b05 (diff)
downloadrails-68e3fb81090ba67575e513407fc2463dba3b002b.tar.gz
rails-68e3fb81090ba67575e513407fc2463dba3b002b.tar.bz2
rails-68e3fb81090ba67575e513407fc2463dba3b002b.zip
Fix JSON decoding of newline character with Yaml backend [#3479 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activesupport/test/json')
-rw-r--r--activesupport/test/json/decoding_test.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/test/json/decoding_test.rb b/activesupport/test/json/decoding_test.rb
index a0beb97537..613c7531d9 100644
--- a/activesupport/test/json/decoding_test.rb
+++ b/activesupport/test/json/decoding_test.rb
@@ -41,7 +41,11 @@ class TestJSONDecoding < ActiveSupport::TestCase
[{'d' => Date.new(1970, 1, 1), 's' => ' escape'},{'d' => Date.new(1970, 1, 1), 's' => ' escape'}],
%q([{"d":"1970-01-01","s":"http:\/\/example.com"},{"d":"1970-01-01","s":"http:\/\/example.com"}]) =>
[{'d' => Date.new(1970, 1, 1), 's' => 'http://example.com'},
- {'d' => Date.new(1970, 1, 1), 's' => 'http://example.com'}]
+ {'d' => Date.new(1970, 1, 1), 's' => 'http://example.com'}],
+ # tests escaping of "\n" char with Yaml backend
+ %q("\n") => "\n",
+ %q("\u000a") => "\n",
+ %q({"a":"Line1\u000aLine2"}) => {"a"=>"Line1\nLine2"}
}
# load the default JSON backend