-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathext_test.jsi
117 lines (109 loc) · 3.02 KB
/
ext_test.jsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/local/bin/jsish --I testMode=1 %s
var n, m, c, p;
;'\nBee';
;require('Bee');
;n=Bee.keys();
for (var i of n) {
m=Info.cmds('Bee.'+i);
puts(' '+m.name+'('+m.args+')');
}
;Bee.conf();
;Bee.buzz(2);
;Bee.conf('buzzCnt');
;Bee.buzz(4);
;Bee.pollinate('daisy');
;Bee.pollinate('rose');
;Bee.sting('dave', 3);
;Bee.conf();
;'\nBAKER';
;require('Baker');
;n = Baker.keys();
for (i of n) {
m=Info.cmds('Baker.'+i);
puts(' '+m.name+'('+m.args+')');
}
;Baker.kneed('bakl');
;Baker.conf();
;Baker.kneed('bakl',{minutes:1});
;Baker.slice(1,{coolTime:5});
;Baker.label('rye',.75);
;'\nCar';
;require('Car');
;require('Car',0).conf.info;
;n=Car.keys();
;m=Info.cmds('Car');
;c=new Car();
for (i of n) {
m=Info.cmds('Car.'+i,{constructor:true});
p = (i=='Car'?'new Car':m.name);
puts(' '+p+'('+m.args+')');
}
;c.conf();
;c.shift(2);
;c.shift(3);
;c.setSpeed('max', 3);
;c.fix('brakes', {Max:1, Cnt:2});
;c.conf();
delete c;
/*
;Car_fix_Data.conf();
;Car_fix_Data.info();
;Car_fix_Data.get();
;Car_fix_Data.get(null);
;Car_fix_Data.set(null,{Cnt:3});
;Car_fix_Data.incr(null,'Cnt');
;Car_fix_Data.incr(null,'Max');
;Car_fix_Data.incr(null,'Max', 3.3);
;Car_Data.get();
*/
/*
=!EXPECTSTART!=
'
Bee'
require('Bee') ==> 1
n=Bee.keys() ==> [ "conf", "buzz", "sting", "pollinate" ]
Bee.conf(options:object|string=void)
Bee.buzz(n1:number)
Bee.sting(victim:string, times:number)
Bee.pollinate(flower:string='daisy', times:number=1)
Bee.conf() ==> { buzzCnt:0, flower:"", max:0, pollinateCnt:0, stingCnt:0, type:"Drone" }
Bee.buzz(2) ==> 2
Bee.conf('buzzCnt') ==> 2
Bee.buzz(4) ==> 6
Bee.pollinate('daisy') ==> undefined
Bee.pollinate('rose') ==> undefined
Bee.sting('dave', 3) ==> stung dave 3 times
Bee.conf() ==> { buzzCnt:6, flower:"rose", max:0, pollinateCnt:2, stingCnt:3, type:"Drone" }
'
BAKER'
require('Baker') ==> 1
n = Baker.keys() ==> [ "conf", "kneed", "slice", "label" ]
Baker.conf(options:object|string=void)
Baker.kneed(name:string, options:object=void)
Baker.slice(loafType:number, options:object=void)
Baker.label(pref:string, end:number)
Baker.kneed('bakl') ==> undefined
Baker.conf() ==> { cnt:0, kneedCnt:1, kneedMins:0, max:0 }
Baker.kneed('bakl',{minutes:1}) ==> undefined
Baker.slice(1,{coolTime:5}) ==> 101
Baker.label('rye',.75) ==> rye_0.75
'
Car'
require('Car') ==> 1
require('Car',0).conf.info ==> { carstuff:true, mynum:1 }
n=Car.keys() ==> [ "Car", "conf", "shift", "setSpeed", "fix" ]
m=Info.cmds('Car') ==> { args:"options:object=void", constructor:true, help:"Extension to create a Car object command.", name:"Car", retType:"any", type:"object" }
c=new Car() ==> "#Car_1"
new Car(options:object=void)
Car.conf(options:object|string=void)
Car.shift(gear:number)
Car.setSpeed(pref:string, times:number)
Car.fix(str:string, options:object=void)
c.conf() ==> { callback:null, gear:0, maxSpeed:120, shiftCnt:0 }
c.shift(2) ==> 2
c.shift(3) ==> 3
c.setSpeed('max', 3) ==> accel max 3 times
c.fix('brakes', {Max:1, Cnt:2}) ==> undefined
c.conf() ==> { callback:null, gear:3, maxSpeed:120, shiftCnt:2 }
=!EXPECTEND!=
*/