diff options
Diffstat (limited to 'lib/rb/spec/json_protocol_spec.rb')
-rw-r--r-- | lib/rb/spec/json_protocol_spec.rb | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/lib/rb/spec/json_protocol_spec.rb b/lib/rb/spec/json_protocol_spec.rb index 9fb6b7bfd..b6b46bff3 100644 --- a/lib/rb/spec/json_protocol_spec.rb +++ b/lib/rb/spec/json_protocol_spec.rb @@ -293,15 +293,36 @@ describe 'JsonProtocol' do it "should read json escape char" do @trans.write('0054') @prot.read_json_escape_char.should == 'T' + + @trans.write("\"\\\"\"") + @prot.read_json_string(false).should == "\"" + + @trans.write("\"\\\\\"") + @prot.read_json_string(false).should == "\\" + + @trans.write("\"\\/\"") + @prot.read_json_string(false).should == "\/" + + @trans.write("\"\\b\"") + @prot.read_json_string(false).should == "\b" + + @trans.write("\"\\f\"") + @prot.read_json_string(false).should == "\f" + + @trans.write("\"\\n\"") + @prot.read_json_string(false).should == "\n" + + @trans.write("\"\\r\"") + @prot.read_json_string(false).should == "\r" + + @trans.write("\"\\t\"") + @prot.read_json_string(false).should == "\t" end it "should read json string" do @trans.write("\"\\P") expect {@prot.read_json_string(false)}.to raise_error(Thrift::ProtocolException) - @trans.write("\"\\n\"") - @prot.read_json_string(false).should == "\\n" - @trans.write("\"this is a test string\"") @prot.read_json_string.should == "this is a test string" end |