Skip to content

Commit

Permalink
robustify
Browse files Browse the repository at this point in the history
  • Loading branch information
oberstet committed May 19, 2019
1 parent 196b66f commit 5080981
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 10 additions & 2 deletions test/test_binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ function run_test (test, ser) {

pl2.push(session.call('com.myapp.echo', [vals1[i]]).then(
function (res) {
test.log("Result [com.myapp.echo]:", res);
if (Buffer.isBuffer(res)) {
test.log("Result [com.myapp.echo]:", res.toString('hex'));
} else {
test.log("Result [com.myapp.echo]:", res);
}
},
function (err) {
test.log("Error [com.myapp.echo]:", err.error, err.args, err.kwargs);
Expand All @@ -83,7 +87,11 @@ function run_test (test, ser) {

pl2.push(session.call('any.echo', [vals1[i]]).then(
function (res) {
test.log("Result [any.echo]:", res);
if (Buffer.isBuffer(res)) {
test.log("Result [any.echo]:", res.toString('hex'));
} else {
test.log("Result [any.echo]:", res);
}
},
function (err) {
test.log("Error [any.echo]:", err.error, err.args, err.kwargs);
Expand Down
8 changes: 4 additions & 4 deletions test/test_binary_cbor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
6 "Result [any.echo]:" {"a":5,"b":"hello2"}
7 "Result [any.echo]:" [-9007199254740991,9007199254740991]
8 "Result [any.echo]:" null
9 "Result [any.echo]:" [0,1,2,3,4,5,6,7]
10 "Result [any.echo]:" [143,68,213,9,224,73,42,206,196,252,16,154,3,10,92,117,31,6,63,183,67,204,56,143,14,215,34,186,204,59,198,108]
9 "Result [any.echo]:" "0001020304050607"
10 "Result [any.echo]:" "8f44d509e0492acec4fc109a030a5c751f063fb743cc388f0ed722bacc3bc66c"
11 "Result [com.myapp.echo]:" 1.7
12 "Result [com.myapp.echo]:" "hello"
13 "Result [com.myapp.echo]:" [1,2,-3]
14 "Result [com.myapp.echo]:" {"a":5,"b":"hello2"}
15 "Result [com.myapp.echo]:" [-9007199254740991,9007199254740991]
16 "Result [com.myapp.echo]:" null
17 "Result [com.myapp.echo]:" [0,1,2,3,4,5,6,7]
18 "Result [com.myapp.echo]:" [143,68,213,9,224,73,42,206,196,252,16,154,3,10,92,117,31,6,63,183,67,204,56,143,14,215,34,186,204,59,198,108]
17 "Result [com.myapp.echo]:" "0001020304050607"
18 "Result [com.myapp.echo]:" "8f44d509e0492acec4fc109a030a5c751f063fb743cc388f0ed722bacc3bc66c"
19 "All finished."

0 comments on commit 5080981

Please sign in to comment.