THRIFT-1238 Thrift JS client cannot read map of structures(TestCase)
Patch: Henrique Mendonca
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1147301 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/js/test/test.html b/lib/js/test/test.html
index bd124af..5039edb 100644
--- a/lib/js/test/test.html
+++ b/lib/js/test/test.html
@@ -215,9 +215,47 @@
module("Insanity");
test("testInsanity", function() {
- var insanity;
- var res = client.testInsanity(insanity);
- ok(res);
+ var insanity = {
+ "1":{
+ "3":{
+ "userMap":{ "8":8, "5":5 },
+ "xtructs":[{
+ "string_thing":"Goodbye4",
+ "byte_thing":4,
+ "i32_thing":4,
+ "i64_thing":4
+ },
+ {
+ "string_thing":"Hello2",
+ "byte_thing":2,
+ "i32_thing":2,
+ "i64_thing":2
+ }
+ ]
+ },
+ "2":{
+ "userMap":{ "8":8, "5":5 },
+ "xtructs":[{
+ "string_thing":"Goodbye4",
+ "byte_thing":4,
+ "i32_thing":4,
+ "i64_thing":4
+ },
+ {
+ "string_thing":"Hello2",
+ "byte_thing":2,
+ "i32_thing":2,
+ "i64_thing":2
+ }
+ ]
+ }
+ },
+ "2":{ "6":{ "userMap":null, "xtructs":null } }
+ };
+ var res = client.testInsanity("");
+ ok(res, JSON.stringify(res));
+ ok(insanity, JSON.stringify(insanity));
+ equals(JSON.stringify(res), JSON.stringify(insanity)) //TODO: read and compare maps recursively
});