summaryrefslogtreecommitdiff
path: root/test/rb
diff options
context:
space:
mode:
authorNobuaki Sukegawa <nsukeg@gmail.com>2015-10-10 01:52:13 +0900
committerRoger Meier <roger@apache.org>2015-10-11 00:18:02 +0200
commit8cd519f7a3b9436ae95049ee4299441306bdeb5c (patch)
tree1c7ac1b21749e6ad1c8d1e8e1bb28df8527d0cae /test/rb
parent56e5b9b01b5a033306d583cd2aec07a0dda3c9f5 (diff)
downloadthrift-8cd519f7a3b9436ae95049ee4299441306bdeb5c.tar.gz
THRIFT-3374 Ruby TJSONProtocol fails to unescape string values
This closes #640
Diffstat (limited to 'test/rb')
-rwxr-xr-xtest/rb/integration/TestClient.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/rb/integration/TestClient.rb b/test/rb/integration/TestClient.rb
index d04f47507..8fd63369e 100755
--- a/test/rb/integration/TestClient.rb
+++ b/test/rb/integration/TestClient.rb
@@ -89,7 +89,16 @@ class SimpleClientTest < Test::Unit::TestCase
def test_string
p 'test_string'
- assert_equal(@client.testString('string'), 'string')
+ test_string =
+ 'quote: \" backslash:' +
+ ' forwardslash-escaped: \/ ' +
+ ' backspace: \b formfeed: \f newline: \n return: \r tab: ' +
+ ' now-all-of-them-together: "\\\/\b\n\r\t' +
+ ' now-a-bunch-of-junk: !@#$%&()(&%$#{}{}<><><' +
+ ' char-to-test-json-parsing: ]] \"]] \\" }}}{ [[[ '
+
+ result_string = @client.testString(test_string)
+ assert_equal(test_string, result_string.force_encoding(Encoding::UTF_8))
end
def test_bool