Skip to content

Commit a2e090c

Browse files
author
Jason Kridner
committed
wired_basic_test.js: reordered tests
1 parent b26ffc1 commit a2e090c

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

test/wired_basic_test.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
var b = require('bonescript');
22

3-
b.setDate(Date().toString(), onSetDate);
3+
b.getPlatform(onGetPlatform);
4+
5+
function onGetPlatform(x) {
6+
if(!x.name || !x.serialNumber || !x.version)
7+
err('getPlatform returned ' + JSON.stringify(x));
8+
console.log('Name = ' + x.name);
9+
console.log('S/N = ' + x.serialNumber);
10+
console.log('Version = ' + x.version);
11+
console.log('BoneScript version = ' + x.bonescript);
12+
if(x.bonescript != '0.2.2'))
13+
err('BoneScript 0.2.2 required');
14+
b.setDate(Date().toString(), onSetDate);
15+
}
416

517
function onSetDate(x) {
618
if(x.stdout !== null) {
@@ -11,16 +23,6 @@ function onSetDate(x) {
1123

1224
function onEcho(x) {
1325
if(x.data != 'test') err('doEcho returned ' + JSON.stringify(x));
14-
b.getPlatform(onGetPlatform);
15-
}
16-
17-
function onGetPlatform(x) {
18-
if(!x.name || !x.serialNumber || !x.version || (x.bonescript != '0.2.2'))
19-
err('getPlatform returned ' + JSON.stringify(x));
20-
console.log('Name = ' + x.name);
21-
console.log('S/N = ' + x.serialNumber);
22-
console.log('Version = ' + x.version);
23-
console.log('BoneScript version = ' + x.bonescript);
2426
b.getPinMode('P9_20', onGetPinMode);
2527
}
2628

0 commit comments

Comments
 (0)