mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
Client: JS
Extend QUnit test cases git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1390990 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6e283a0e6d
commit
6af2ec09b3
@ -47,6 +47,7 @@ module("Base Types");
|
||||
equal(client.testVoid(), undefined);
|
||||
});
|
||||
test("String", function() {
|
||||
equal(client.testString(''), '');
|
||||
equal(client.testString(stringTest), stringTest);
|
||||
|
||||
var specialCharacters = 'quote: \" backslash:' +
|
||||
@ -57,16 +58,24 @@ module("Base Types");
|
||||
equal(client.testString(specialCharacters),specialCharacters);
|
||||
});
|
||||
test("Double", function() {
|
||||
equal(client.testDouble(0), 0);
|
||||
equal(client.testDouble(-1), -1);
|
||||
equal(client.testDouble(3.14), 3.14);
|
||||
equal(client.testDouble(Math.pow(2,60)), Math.pow(2,60));
|
||||
});
|
||||
test("Byte", function() {
|
||||
equal(client.testByte(0), 0);
|
||||
equal(client.testByte(0x01), 0x01);
|
||||
});
|
||||
test("I32", function() {
|
||||
equal(client.testI32(0), 0);
|
||||
equal(client.testI32(Math.pow(2,30)), Math.pow(2,30));
|
||||
equal(client.testI32(-Math.pow(2,30)), -Math.pow(2,30));
|
||||
});
|
||||
test("I64", function() {
|
||||
equal(client.testI64(0), 0);
|
||||
equal(client.testI64(Math.pow(2,60)), Math.pow(2,60));
|
||||
equal(client.testI64(-Math.pow(2,60)), -Math.pow(2,60));
|
||||
});
|
||||
|
||||
|
||||
@ -371,7 +380,7 @@ module("Async");
|
||||
client.testI64(Math.pow(-2,61), function(result) {
|
||||
equal(result, Math.pow(-2,61));
|
||||
})
|
||||
.error( function(e) { ok(false); } )
|
||||
.error( function(xhr, status, e) { ok(false, e.message); } )
|
||||
.success(function(result) {
|
||||
equal(result, Math.pow(-2,61));
|
||||
})
|
||||
@ -390,7 +399,7 @@ module("Async");
|
||||
ok(false);
|
||||
QUnit.start();
|
||||
})
|
||||
.error(function(xhr,status,e){
|
||||
.error(function(xhr, status, e){
|
||||
equal(e.errorCode, 1001);
|
||||
equal(e.message, "Xception");
|
||||
QUnit.start();
|
||||
|
Loading…
Reference in New Issue
Block a user