Upgrading dependencies to gorealis v2 and thrift 0.12.0
This commit is contained in:
parent
7cbbea498b
commit
54b8d7942a
1327 changed files with 137391 additions and 61476 deletions
428
vendor/git.apache.org/thrift.git/lib/js/test/test-async.js
generated
vendored
428
vendor/git.apache.org/thrift.git/lib/js/test/test-async.js
generated
vendored
|
@ -17,9 +17,9 @@
|
|||
* under the License.
|
||||
*/
|
||||
/* jshint -W100 */
|
||||
|
||||
|
||||
/*
|
||||
* Fully Async JavaScript test suite for ThriftTest.thrift.
|
||||
* Fully Async JavaScript test suite for ThriftTest.thrift.
|
||||
* These tests are designed to exercise the WebSocket transport
|
||||
* (which is exclusively async).
|
||||
*
|
||||
|
@ -30,319 +30,341 @@
|
|||
|
||||
|
||||
// all Languages in UTF-8
|
||||
var stringTest = "Afrikaans, Alemannisch, Aragonés, العربية, مصرى, Asturianu, Aymar aru, Azərbaycan, Башҡорт, Boarisch, Žemaitėška, Беларуская, Беларуская (тарашкевіца), Български, Bamanankan, বাংলা, Brezhoneg, Bosanski, Català, Mìng-dĕ̤ng-ngṳ̄, Нохчийн, Cebuano, ᏣᎳᎩ, Česky, Словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ, Чӑвашла, Cymraeg, Dansk, Zazaki, ދިވެހިބަސް, Ελληνικά, Emiliàn e rumagnòl, English, Esperanto, Español, Eesti, Euskara, فارسی, Suomi, Võro, Føroyskt, Français, Arpetan, Furlan, Frysk, Gaeilge, 贛語, Gàidhlig, Galego, Avañe'ẽ, ગુજરાતી, Gaelg, עברית, हिन्दी, Fiji Hindi, Hrvatski, Kreyòl ayisyen, Magyar, Հայերեն, Interlingua, Bahasa Indonesia, Ilokano, Ido, Íslenska, Italiano, 日本語, Lojban, Basa Jawa, ქართული, Kongo, Kalaallisut, ಕನ್ನಡ, 한국어, Къарачай-Малкъар, Ripoarisch, Kurdî, Коми, Kernewek, Кыргызча, Latina, Ladino, Lëtzebuergesch, Limburgs, Lingála, ລາວ, Lietuvių, Latviešu, Basa Banyumasan, Malagasy, Македонски, മലയാളം, मराठी, Bahasa Melayu, مازِرونی, Nnapulitano, Nedersaksisch, नेपाल भाषा, Nederlands, Norsk (nynorsk), Norsk (bokmål), Nouormand, Diné bizaad, Occitan, Иронау, Papiamentu, Deitsch, Norfuk / Pitkern, Polski, پنجابی, پښتو, Português, Runa Simi, Rumantsch, Romani, Română, Русский, Саха тыла, Sardu, Sicilianu, Scots, Sámegiella, Simple English, Slovenčina, Slovenščina, Српски / Srpski, Seeltersk, Svenska, Kiswahili, தமிழ், తెలుగు, Тоҷикӣ, ไทย, Türkmençe, Tagalog, Türkçe, Татарча/Tatarça, Українська, اردو, Tiếng Việt, Volapük, Walon, Winaray, 吴语, isiXhosa, ייִדיש, Yorùbá, Zeêuws, 中文, Bân-lâm-gú, 粵語";
|
||||
|
||||
function checkRecursively(map1, map2) {
|
||||
const stringTest = "Afrikaans, Alemannisch, Aragonés, العربية, مصرى, Asturianu, Aymar aru, Azərbaycan, Башҡорт, Boarisch, Žemaitėška, Беларуская, Беларуская (тарашкевіца), Български, Bamanankan, বাংলা, Brezhoneg, Bosanski, Català, Mìng-dĕ̤ng-ngṳ̄, Нохчийн, Cebuano, ᏣᎳᎩ, Česky, Словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ, Чӑвашла, Cymraeg, Dansk, Zazaki, ދިވެހިބަސް, Ελληνικά, Emiliàn e rumagnòl, English, Esperanto, Español, Eesti, Euskara, فارسی, Suomi, Võro, Føroyskt, Français, Arpetan, Furlan, Frysk, Gaeilge, 贛語, Gàidhlig, Galego, Avañe'ẽ, ગુજરાતી, Gaelg, עברית, हिन्दी, Fiji Hindi, Hrvatski, Kreyòl ayisyen, Magyar, Հայերեն, Interlingua, Bahasa Indonesia, Ilokano, Ido, Íslenska, Italiano, 日本語, Lojban, Basa Jawa, ქართული, Kongo, Kalaallisut, ಕನ್ನಡ, 한국어, Къарачай-Малкъар, Ripoarisch, Kurdî, Коми, Kernewek, Кыргызча, Latina, Ladino, Lëtzebuergesch, Limburgs, Lingála, ລາວ, Lietuvių, Latviešu, Basa Banyumasan, Malagasy, Македонски, മലയാളം, मराठी, Bahasa Melayu, مازِرونی, Nnapulitano, Nedersaksisch, नेपाल भाषा, Nederlands, Norsk (nynorsk), Norsk (bokmål), Nouormand, Diné bizaad, Occitan, Иронау, Papiamentu, Deitsch, Norfuk / Pitkern, Polski, پنجابی, پښتو, Português, Runa Simi, Rumantsch, Romani, Română, Русский, Саха тыла, Sardu, Sicilianu, Scots, Sámegiella, Simple English, Slovenčina, Slovenščina, Српски / Srpski, Seeltersk, Svenska, Kiswahili, தமிழ், తెలుగు, Тоҷикӣ, ไทย, Türkmençe, Tagalog, Türkçe, Татарча/Tatarça, Українська, اردو, Tiếng Việt, Volapük, Walon, Winaray, 吴语, isiXhosa, ייִדיש, Yorùbá, Zeêuws, 中文, Bân-lâm-gú, 粵語";
|
||||
|
||||
function checkRecursively(assert, map1, map2) {
|
||||
if (typeof map1 !== 'function' && typeof map2 !== 'function') {
|
||||
if (!map1 || typeof map1 !== 'object') {
|
||||
equal(map1, map2);
|
||||
assert.equal(map1, map2);
|
||||
} else {
|
||||
for (var key in map1) {
|
||||
checkRecursively(map1[key], map2[key]);
|
||||
for (let key in map1) {
|
||||
checkRecursively(assert, map1[key], map2[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module("Base Types");
|
||||
QUnit.module('Base Types');
|
||||
|
||||
asyncTest("Void", function() {
|
||||
expect( 1 );
|
||||
QUnit.test('Void', function(assert) {
|
||||
assert.expect(1);
|
||||
const done = assert.async();
|
||||
client.testVoid(function(result) {
|
||||
equal(result, undefined);
|
||||
QUnit.start();
|
||||
assert.equal(result, undefined);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
asyncTest("String", function() {
|
||||
expect( 3 );
|
||||
QUnit.stop(2);
|
||||
client.testString('', function(result){
|
||||
equal(result, '');
|
||||
QUnit.start();
|
||||
|
||||
|
||||
QUnit.test('String', function(assert) {
|
||||
assert.expect(3);
|
||||
const done = assert.async(3);
|
||||
client.testString('', function(result) {
|
||||
assert.equal(result, '');
|
||||
done();
|
||||
});
|
||||
client.testString(stringTest, function(result){
|
||||
equal(result, stringTest);
|
||||
QUnit.start();
|
||||
client.testString(stringTest, function(result) {
|
||||
assert.equal(result, stringTest);
|
||||
done();
|
||||
});
|
||||
|
||||
var specialCharacters = 'quote: \" backslash:' +
|
||||
const specialCharacters = '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: !@#$%&()(&%$#{}{}<><><';
|
||||
client.testString(specialCharacters, function(result){
|
||||
equal(result, specialCharacters);
|
||||
QUnit.start();
|
||||
client.testString(specialCharacters, function(result) {
|
||||
assert.equal(result, specialCharacters);
|
||||
done();
|
||||
});
|
||||
});
|
||||
asyncTest("Double", function() {
|
||||
expect( 4 );
|
||||
QUnit.stop(3);
|
||||
client.testDouble(0, function(result){
|
||||
equal(result, 0);
|
||||
QUnit.start();
|
||||
QUnit.test('Double', function(assert) {
|
||||
assert.expect(4);
|
||||
const done = assert.async(4);
|
||||
client.testDouble(0, function(result) {
|
||||
assert.equal(result, 0);
|
||||
done();
|
||||
});
|
||||
client.testDouble(-1, function(result){
|
||||
equal(result, -1);
|
||||
QUnit.start();
|
||||
client.testDouble(-1, function(result) {
|
||||
assert.equal(result, -1);
|
||||
done();
|
||||
});
|
||||
client.testDouble(3.14, function(result){
|
||||
equal(result, 3.14);
|
||||
QUnit.start();
|
||||
client.testDouble(3.14, function(result) {
|
||||
assert.equal(result, 3.14);
|
||||
done();
|
||||
});
|
||||
client.testDouble(Math.pow(2,60), function(result){
|
||||
equal(result, Math.pow(2,60));
|
||||
QUnit.start();
|
||||
client.testDouble(Math.pow(2, 60), function(result) {
|
||||
assert.equal(result, Math.pow(2, 60));
|
||||
done();
|
||||
});
|
||||
});
|
||||
// TODO: add testBinary()
|
||||
asyncTest("Byte", function() {
|
||||
expect( 2 );
|
||||
QUnit.stop();
|
||||
// TODO: add testBinary()
|
||||
QUnit.test('Byte', function(assert) {
|
||||
assert.expect(2);
|
||||
const done = assert.async(2);
|
||||
client.testByte(0, function(result) {
|
||||
equal(result, 0);
|
||||
QUnit.start();
|
||||
assert.equal(result, 0);
|
||||
done();
|
||||
});
|
||||
client.testByte(0x01, function(result) {
|
||||
equal(result, 0x01);
|
||||
QUnit.start();
|
||||
assert.equal(result, 0x01);
|
||||
done();
|
||||
});
|
||||
});
|
||||
asyncTest("I32", function() {
|
||||
expect( 3 );
|
||||
QUnit.stop(2);
|
||||
client.testI32(0, function(result){
|
||||
equal(result, 0);
|
||||
QUnit.start();
|
||||
QUnit.test('I32', function(assert) {
|
||||
assert.expect(3);
|
||||
const done = assert.async(3);
|
||||
client.testI32(0, function(result) {
|
||||
assert.equal(result, 0);
|
||||
done();
|
||||
});
|
||||
client.testI32(Math.pow(2,30), function(result){
|
||||
equal(result, Math.pow(2,30));
|
||||
QUnit.start();
|
||||
client.testI32(Math.pow(2, 30), function(result) {
|
||||
assert.equal(result, Math.pow(2, 30));
|
||||
done();
|
||||
});
|
||||
client.testI32(-Math.pow(2,30), function(result){
|
||||
equal(result, -Math.pow(2,30));
|
||||
QUnit.start();
|
||||
client.testI32(-Math.pow(2, 30), function(result) {
|
||||
assert.equal(result, -Math.pow(2, 30));
|
||||
done();
|
||||
});
|
||||
});
|
||||
asyncTest("I64", function() {
|
||||
expect( 3 );
|
||||
QUnit.stop(2);
|
||||
client.testI64(0, function(result){
|
||||
equal(result, 0);
|
||||
QUnit.start();
|
||||
QUnit.test('I64', function(assert) {
|
||||
assert.expect(3);
|
||||
const done = assert.async(3);
|
||||
client.testI64(0, function(result) {
|
||||
assert.equal(result, 0);
|
||||
done();
|
||||
});
|
||||
//This is usually 2^60 but JS cannot represent anything over 2^52 accurately
|
||||
client.testI64(Math.pow(2,52), function(result){
|
||||
equal(result, Math.pow(2,52));
|
||||
QUnit.start();
|
||||
client.testI64(Math.pow(2, 52), function(result) {
|
||||
assert.equal(result, Math.pow(2, 52));
|
||||
done();
|
||||
});
|
||||
client.testI64(-Math.pow(2,52), function(result){
|
||||
equal(result, -Math.pow(2,52));
|
||||
QUnit.start();
|
||||
client.testI64(-Math.pow(2, 52), function(result) {
|
||||
assert.equal(result, -Math.pow(2, 52));
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
module("Structured Types");
|
||||
|
||||
asyncTest("Struct", function() {
|
||||
expect( 5 );
|
||||
var structTestInput = new ThriftTest.Xtruct();
|
||||
|
||||
QUnit.module('Structured Types');
|
||||
|
||||
QUnit.test('Struct', function(assert) {
|
||||
assert.expect(5);
|
||||
const done = assert.async();
|
||||
const structTestInput = new ThriftTest.Xtruct();
|
||||
structTestInput.string_thing = 'worked';
|
||||
structTestInput.byte_thing = 0x01;
|
||||
structTestInput.i32_thing = Math.pow(2,30);
|
||||
structTestInput.i32_thing = Math.pow(2, 30);
|
||||
//This is usually 2^60 but JS cannot represent anything over 2^52 accurately
|
||||
structTestInput.i64_thing = Math.pow(2,52);
|
||||
structTestInput.i64_thing = Math.pow(2, 52);
|
||||
|
||||
client.testStruct(structTestInput, function(result){
|
||||
equal(result.string_thing, structTestInput.string_thing);
|
||||
equal(result.byte_thing, structTestInput.byte_thing);
|
||||
equal(result.i32_thing, structTestInput.i32_thing);
|
||||
equal(result.i64_thing, structTestInput.i64_thing);
|
||||
equal(JSON.stringify(result), JSON.stringify(structTestInput));
|
||||
QUnit.start();
|
||||
client.testStruct(structTestInput, function(result) {
|
||||
assert.equal(result.string_thing, structTestInput.string_thing);
|
||||
assert.equal(result.byte_thing, structTestInput.byte_thing);
|
||||
assert.equal(result.i32_thing, structTestInput.i32_thing);
|
||||
assert.equal(result.i64_thing, structTestInput.i64_thing);
|
||||
assert.equal(JSON.stringify(result), JSON.stringify(structTestInput));
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest("Nest", function() {
|
||||
expect( 7 );
|
||||
var xtrTestInput = new ThriftTest.Xtruct();
|
||||
QUnit.test('Nest', function(assert) {
|
||||
assert.expect(7);
|
||||
const done = assert.async();
|
||||
const xtrTestInput = new ThriftTest.Xtruct();
|
||||
xtrTestInput.string_thing = 'worked';
|
||||
xtrTestInput.byte_thing = 0x01;
|
||||
xtrTestInput.i32_thing = Math.pow(2,30);
|
||||
xtrTestInput.i32_thing = Math.pow(2, 30);
|
||||
//This is usually 2^60 but JS cannot represent anything over 2^52 accurately
|
||||
xtrTestInput.i64_thing = Math.pow(2,52);
|
||||
|
||||
var nestTestInput = new ThriftTest.Xtruct2();
|
||||
xtrTestInput.i64_thing = Math.pow(2, 52);
|
||||
|
||||
const nestTestInput = new ThriftTest.Xtruct2();
|
||||
nestTestInput.byte_thing = 0x02;
|
||||
nestTestInput.struct_thing = xtrTestInput;
|
||||
nestTestInput.i32_thing = Math.pow(2,15);
|
||||
|
||||
client.testNest(nestTestInput, function(result){
|
||||
equal(result.byte_thing, nestTestInput.byte_thing);
|
||||
equal(result.struct_thing.string_thing, nestTestInput.struct_thing.string_thing);
|
||||
equal(result.struct_thing.byte_thing, nestTestInput.struct_thing.byte_thing);
|
||||
equal(result.struct_thing.i32_thing, nestTestInput.struct_thing.i32_thing);
|
||||
equal(result.struct_thing.i64_thing, nestTestInput.struct_thing.i64_thing);
|
||||
equal(result.i32_thing, nestTestInput.i32_thing);
|
||||
equal(JSON.stringify(result), JSON.stringify(nestTestInput));
|
||||
QUnit.start();
|
||||
nestTestInput.i32_thing = Math.pow(2, 15);
|
||||
|
||||
client.testNest(nestTestInput, function(result) {
|
||||
assert.equal(result.byte_thing, nestTestInput.byte_thing);
|
||||
assert.equal(result.struct_thing.string_thing, nestTestInput.struct_thing.string_thing);
|
||||
assert.equal(result.struct_thing.byte_thing, nestTestInput.struct_thing.byte_thing);
|
||||
assert.equal(result.struct_thing.i32_thing, nestTestInput.struct_thing.i32_thing);
|
||||
assert.equal(result.struct_thing.i64_thing, nestTestInput.struct_thing.i64_thing);
|
||||
assert.equal(result.i32_thing, nestTestInput.i32_thing);
|
||||
assert.equal(JSON.stringify(result), JSON.stringify(nestTestInput));
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest("Map", function() {
|
||||
expect( 3 );
|
||||
var mapTestInput = {7:77, 8:88, 9:99};
|
||||
QUnit.test('Map', function(assert) {
|
||||
assert.expect(3);
|
||||
const done = assert.async();
|
||||
const mapTestInput = {7: 77, 8: 88, 9: 99};
|
||||
|
||||
client.testMap(mapTestInput, function(result){
|
||||
for (var key in result) {
|
||||
equal(result[key], mapTestInput[key]);
|
||||
client.testMap(mapTestInput, function(result) {
|
||||
for (let key in result) {
|
||||
assert.equal(result[key], mapTestInput[key]);
|
||||
}
|
||||
QUnit.start();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest("StringMap", function() {
|
||||
expect( 6 );
|
||||
var mapTestInput = {
|
||||
"a":"123", "a b":"with spaces ", "same":"same", "0":"numeric key",
|
||||
"longValue":stringTest, stringTest:"long key"
|
||||
QUnit.test('StringMap', function(assert) {
|
||||
assert.expect(6);
|
||||
const done = assert.async();
|
||||
const mapTestInput = {
|
||||
'a': '123', 'a b': 'with spaces ', 'same': 'same', '0': 'numeric key',
|
||||
'longValue': stringTest, stringTest: 'long key'
|
||||
};
|
||||
|
||||
client.testStringMap(mapTestInput, function(result){
|
||||
for (var key in result) {
|
||||
equal(result[key], mapTestInput[key]);
|
||||
client.testStringMap(mapTestInput, function(result) {
|
||||
for (let key in result) {
|
||||
assert.equal(result[key], mapTestInput[key]);
|
||||
}
|
||||
QUnit.start();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest("Set", function() {
|
||||
expect( 1 );
|
||||
var setTestInput = [1,2,3];
|
||||
client.testSet(setTestInput, function(result){
|
||||
ok(result, setTestInput);
|
||||
QUnit.start();
|
||||
QUnit.test('Set', function(assert) {
|
||||
assert.expect(1);
|
||||
const done = assert.async();
|
||||
const setTestInput = [1, 2, 3];
|
||||
client.testSet(setTestInput, function(result) {
|
||||
assert.ok(result, setTestInput);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest("List", function() {
|
||||
expect( 1 );
|
||||
var listTestInput = [1,2,3];
|
||||
client.testList(listTestInput, function(result){
|
||||
ok(result, listTestInput);
|
||||
QUnit.start();
|
||||
QUnit.test('List', function(assert) {
|
||||
assert.expect(1);
|
||||
const done = assert.async();
|
||||
const listTestInput = [1, 2, 3];
|
||||
client.testList(listTestInput, function(result) {
|
||||
assert.ok(result, listTestInput);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest("Enum", function() {
|
||||
expect( 1 );
|
||||
client.testEnum(ThriftTest.Numberz.ONE, function(result){
|
||||
equal(result, ThriftTest.Numberz.ONE);
|
||||
QUnit.start();
|
||||
QUnit.test('Enum', function(assert) {
|
||||
assert.expect(1);
|
||||
const done = assert.async();
|
||||
client.testEnum(ThriftTest.Numberz.ONE, function(result) {
|
||||
assert.equal(result, ThriftTest.Numberz.ONE);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest("TypeDef", function() {
|
||||
expect( 1 );
|
||||
client.testTypedef(69, function(result){
|
||||
equal(result, 69);
|
||||
QUnit.start();
|
||||
QUnit.test('TypeDef', function(assert) {
|
||||
assert.expect(1);
|
||||
const done = assert.async();
|
||||
client.testTypedef(69, function(result) {
|
||||
assert.equal(result, 69);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
module("deeper!");
|
||||
QUnit.module('deeper!');
|
||||
|
||||
asyncTest("MapMap", function() {
|
||||
expect( 16 );
|
||||
var mapMapTestExpectedResult = {
|
||||
"4":{"1":1,"2":2,"3":3,"4":4},
|
||||
"-4":{"-4":-4, "-3":-3, "-2":-2, "-1":-1}
|
||||
QUnit.test('MapMap', function(assert) {
|
||||
assert.expect(16);
|
||||
const done = assert.async();
|
||||
const mapMapTestExpectedResult = {
|
||||
'4': {'1': 1, '2': 2, '3': 3, '4': 4},
|
||||
'-4': {'-4': -4, '-3': -3, '-2': -2, '-1': -1}
|
||||
};
|
||||
|
||||
client.testMapMap(1, function(result){
|
||||
for (var key in result) {
|
||||
for (var key2 in result[key]) {
|
||||
equal(result[key][key2], mapMapTestExpectedResult[key][key2]);
|
||||
client.testMapMap(1, function(result) {
|
||||
for (let key in result) {
|
||||
for (let key2 in result[key]) {
|
||||
assert.equal(result[key][key2], mapMapTestExpectedResult[key][key2]);
|
||||
}
|
||||
}
|
||||
checkRecursively(result, mapMapTestExpectedResult);
|
||||
QUnit.start();
|
||||
checkRecursively(assert, result, mapMapTestExpectedResult);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
module("Exception");
|
||||
QUnit.module('Exception');
|
||||
|
||||
asyncTest("Xception", function() {
|
||||
expect(2);
|
||||
client.testException("Xception", function(e){
|
||||
equal(e.errorCode, 1001);
|
||||
equal(e.message, "Xception");
|
||||
QUnit.start();
|
||||
QUnit.test('Xception', function(assert) {
|
||||
assert.expect(2);
|
||||
const done = assert.async();
|
||||
client.testException('Xception', function(e) {
|
||||
assert.equal(e.errorCode, 1001);
|
||||
assert.equal(e.message, 'Xception');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest("no Exception", 0, function() {
|
||||
expect( 1 );
|
||||
client.testException("no Exception", function(e){
|
||||
ok(!e);
|
||||
QUnit.start();
|
||||
QUnit.test('no Exception', function(assert) {
|
||||
assert.expect(1);
|
||||
const done = assert.async();
|
||||
client.testException('no Exception', function(e) {
|
||||
assert.ok(!e);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
module("Insanity");
|
||||
QUnit.module('Insanity');
|
||||
|
||||
asyncTest("testInsanity", function() {
|
||||
expect( 24 );
|
||||
var insanity = {
|
||||
"1":{
|
||||
"2":{
|
||||
"userMap":{ "5":5, "8":8 },
|
||||
"xtructs":[{
|
||||
"string_thing":"Goodbye4",
|
||||
"byte_thing":4,
|
||||
"i32_thing":4,
|
||||
"i64_thing":4
|
||||
QUnit.test('testInsanity', function(assert) {
|
||||
assert.expect(24);
|
||||
const done = assert.async();
|
||||
const insanity = {
|
||||
'1': {
|
||||
'2': {
|
||||
'userMap': { '5': 5, '8': 8 },
|
||||
'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
|
||||
'string_thing': 'Hello2',
|
||||
'byte_thing': 2,
|
||||
'i32_thing': 2,
|
||||
'i64_thing': 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"3":{
|
||||
"userMap":{ "5":5, "8":8 },
|
||||
"xtructs":[{
|
||||
"string_thing":"Goodbye4",
|
||||
"byte_thing":4,
|
||||
"i32_thing":4,
|
||||
"i64_thing":4
|
||||
'3': {
|
||||
'userMap': { '5': 5, '8': 8 },
|
||||
'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
|
||||
'string_thing': 'Hello2',
|
||||
'byte_thing': 2,
|
||||
'i32_thing': 2,
|
||||
'i64_thing': 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"2":{ "6":{ "userMap":null, "xtructs":null } }
|
||||
'2': { '6': { 'userMap': null, 'xtructs': null } }
|
||||
};
|
||||
client.testInsanity(new ThriftTest.Insanity(), function(res){
|
||||
ok(res, JSON.stringify(res));
|
||||
ok(insanity, JSON.stringify(insanity));
|
||||
checkRecursively(res, insanity);
|
||||
QUnit.start();
|
||||
client.testInsanity(new ThriftTest.Insanity(), function(res) {
|
||||
assert.ok(res, JSON.stringify(res));
|
||||
assert.ok(insanity, JSON.stringify(insanity));
|
||||
checkRecursively(assert, res, insanity);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.module('Oneway');
|
||||
|
||||
QUnit.test('testOneway', function(assert) {
|
||||
assert.expect(1);
|
||||
const done = assert.async();
|
||||
client.testOneway(1, function(result) {
|
||||
assert.equal(result, undefined);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue