From 614856afa5ccaf3eca783fa9997f39c38ef7852b Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 5 Jan 2016 13:05:08 -0800 Subject: 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. --- spec/ffi_yajl/encoder_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec') 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 -- cgit v1.2.1