summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-01-05 13:05:08 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-01-05 13:05:08 -0800
commit614856afa5ccaf3eca783fa9997f39c38ef7852b (patch)
tree3cd602a664d84ec815f77d725cc2b6e20010b975 /spec
parent15c6ab5602ea580010e439de272f95c9aae6b577 (diff)
downloadffi-yajl-614856afa5ccaf3eca783fa9997f39c38ef7852b.tar.gz
make sure utf-8 cleaning doesn't grow without bounds
we had a bug where we'd inject utf-8 characters that we'd mangle and then replace with even more utf-8 characters so that any normal attrs would grow without bounds with lots of utf-8 '?' characters.
Diffstat (limited to 'spec')
-rw-r--r--spec/ffi_yajl/encoder_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/ffi_yajl/encoder_spec.rb b/spec/ffi_yajl/encoder_spec.rb
index e7f17ce..13d3511 100644
--- a/spec/ffi_yajl/encoder_spec.rb
+++ b/spec/ffi_yajl/encoder_spec.rb
@@ -209,6 +209,13 @@ describe "FFI_Yajl::Encoder" do
json = encoder.encode(ruby)
expect(json).to match(/Hañs Helmüt/)
end
+
+ it "does not grow after a round trip" do
+ json = encoder.encode(ruby)
+ ruby2 = FFI_Yajl::Parser.parse(json)
+ json2 = encoder.encode(ruby2)
+ expect(json).to eql(json2)
+ end
end
end
end