rbx-trepanning 0.0.4-universal-rubinius-1.2 → 0.0.6-universal-rubinius-1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +682 -0
- data/NEWS +19 -0
- data/README.textile +8 -9
- data/Rakefile +8 -8
- data/app/complete.rb +52 -0
- data/app/complete.rbc +1288 -0
- data/app/irb.rb +1 -2
- data/app/irb.rbc +55 -72
- data/app/llvm.rbc +780 -878
- data/app/method.rb +1 -1
- data/app/method.rbc +31 -35
- data/app/method_name.rbc +2467 -0
- data/app/options.rb +7 -24
- data/app/options.rbc +238 -132
- data/app/rbx-llvm.rbc +2478 -0
- data/app/util.rb +3 -3
- data/app/util.rbc +23 -27
- data/bin/trepanx +4 -3
- data/bin/trepanx.compiled.rbc +42 -32
- data/data/irbrc +41 -0
- data/data/irbrc.compiled.rbc +640 -0
- data/interface/base_intf.rb +9 -5
- data/interface/base_intf.rbc +200 -146
- data/interface/comcodes.rb +10 -8
- data/interface/comcodes.rbc +68 -26
- data/interface/script.rbc +21 -9
- data/interface/user.rb +74 -8
- data/interface/user.rbc +1702 -156
- data/io/input.rb +37 -14
- data/io/input.rbc +869 -320
- data/io/tcpclient.rb +7 -1
- data/io/tcpclient.rbc +205 -113
- data/io/tcpfns.rb +5 -3
- data/io/tcpfns.rbc +82 -40
- data/io/tcpserver.rb +13 -10
- data/io/tcpserver.rbc +236 -183
- data/lib/trepanning.rb +62 -21
- data/lib/trepanning.rbc +1304 -874
- data/lib/{trepanning.rb.orig → trepanning2.rb} +12 -4
- data/processor/breakpoint.rb +4 -1
- data/processor/command/base/cmd.rb +48 -3
- data/processor/command/base/subcmd.rb +2 -1
- data/processor/command/base/submgr.rb +23 -20
- data/processor/command/base/subsubmgr.rb +13 -2
- data/processor/command/complete.rb +7 -17
- data/processor/command/continue.rb +19 -11
- data/processor/command/disassemble.rb +39 -12
- data/processor/command/eval.rb +23 -5
- data/processor/command/help.rb +60 -6
- data/processor/command/info_subcmd/{file.rb → files.rb} +76 -18
- data/processor/command/info_subcmd/line.rb +86 -0
- data/processor/command/info_subcmd/program.rb +2 -11
- data/processor/command/info_subcmd/ruby.rb +62 -0
- data/processor/command/info_subcmd/variables.rb +7 -0
- data/processor/command/irb.rb +39 -7
- data/processor/command/macro.rb +76 -0
- data/processor/command/set_subcmd/confirm.rb +24 -0
- data/processor/command/set_subcmd/max.rb +4 -5
- data/processor/command/show.rb +11 -0
- data/processor/command/show_subcmd/auto.rb +1 -0
- data/processor/command/show_subcmd/basename.rb +1 -2
- data/processor/command/show_subcmd/confirm.rb +18 -0
- data/processor/command/show_subcmd/max.rb +0 -2
- data/processor/command/source.rb +0 -1
- data/processor/default.rb +2 -0
- data/processor/disassemble.rb +1 -0
- data/processor/load_cmds.rb +104 -20
- data/processor/location.rb +11 -12
- data/processor/main.rb +10 -6
- data/processor/mock.rb +6 -2
- data/processor/stepping.rb +1 -4
- data/processor/subcmd.rb +3 -2
- data/processor/validate.rb +3 -3
- data/sample/list-terminal-colors.rbc +158 -4
- data/sample/rocky-trepanx-colors.rb +15 -7
- data/sample/rocky-trepanx-colors.rbc +530 -0
- data/test/data/quit2.cmd +6 -0
- data/test/data/quit2.right +3 -0
- data/test/data/step-bug.cmd +11 -0
- data/test/data/step-bug.right +3 -0
- data/test/example/step-bug.rb +14 -0
- data/test/integration/helper.rb +1 -1
- data/test/integration/skip-test-step-bug.rb +17 -0
- data/test/integration/test-quit.rb +11 -0
- data/test/unit/test-app-util.rb +0 -1
- data/test/unit/test-base-cmd.rb +47 -0
- data/test/unit/test-base-subcmd.rb +2 -2
- data/test/unit/test-base-submgr.rb +24 -0
- data/test/unit/test-cmd-help.rb +4 -0
- data/test/unit/test-completion.rb +38 -0
- data/test/unit/test-intf-user.rb +2 -2
- data/test/unit/test-io-tcpclient.rb +3 -2
- data/test/unit/test-proc-eval.rb +1 -1
- data/test/unit/test-proc-load_cmds.rb +9 -0
- data/test/unit/test-subcmd-help.rb +1 -5
- metadata +182 -167
- data/app/options.rb.orig +0 -154
- data/bin/trepan.orig +0 -0
- data/bin/trepan.rej +0 -11
- data/lib/trepanning.rb.rej +0 -11
- data/sample/rocky-dot-trepanrc.orig +0 -0
- data/sample/rocky-dot-trepanrc.rej +0 -11
@@ -0,0 +1,530 @@
|
|
1
|
+
!RBIX
|
2
|
+
0
|
3
|
+
x
|
4
|
+
M
|
5
|
+
1
|
6
|
+
n
|
7
|
+
n
|
8
|
+
x
|
9
|
+
10
|
10
|
+
__script__
|
11
|
+
i
|
12
|
+
149
|
13
|
+
5
|
14
|
+
7
|
15
|
+
0
|
16
|
+
64
|
17
|
+
47
|
18
|
+
49
|
19
|
+
1
|
20
|
+
1
|
21
|
+
15
|
22
|
+
65
|
23
|
+
7
|
24
|
+
2
|
25
|
+
44
|
26
|
+
43
|
27
|
+
3
|
28
|
+
4
|
29
|
+
5
|
30
|
+
49
|
31
|
+
4
|
32
|
+
1
|
33
|
+
13
|
34
|
+
7
|
35
|
+
5
|
36
|
+
7
|
37
|
+
6
|
38
|
+
64
|
39
|
+
49
|
40
|
+
7
|
41
|
+
2
|
42
|
+
15
|
43
|
+
13
|
44
|
+
7
|
45
|
+
8
|
46
|
+
7
|
47
|
+
9
|
48
|
+
64
|
49
|
+
49
|
50
|
+
7
|
51
|
+
2
|
52
|
+
15
|
53
|
+
13
|
54
|
+
7
|
55
|
+
10
|
56
|
+
44
|
57
|
+
43
|
58
|
+
3
|
59
|
+
4
|
60
|
+
4
|
61
|
+
49
|
62
|
+
4
|
63
|
+
1
|
64
|
+
13
|
65
|
+
7
|
66
|
+
11
|
67
|
+
7
|
68
|
+
12
|
69
|
+
64
|
70
|
+
49
|
71
|
+
7
|
72
|
+
2
|
73
|
+
15
|
74
|
+
13
|
75
|
+
7
|
76
|
+
13
|
77
|
+
7
|
78
|
+
14
|
79
|
+
64
|
80
|
+
49
|
81
|
+
7
|
82
|
+
2
|
83
|
+
15
|
84
|
+
13
|
85
|
+
7
|
86
|
+
15
|
87
|
+
7
|
88
|
+
16
|
89
|
+
64
|
90
|
+
49
|
91
|
+
7
|
92
|
+
2
|
93
|
+
15
|
94
|
+
13
|
95
|
+
7
|
96
|
+
17
|
97
|
+
7
|
98
|
+
14
|
99
|
+
64
|
100
|
+
49
|
101
|
+
7
|
102
|
+
2
|
103
|
+
15
|
104
|
+
49
|
105
|
+
7
|
106
|
+
2
|
107
|
+
15
|
108
|
+
13
|
109
|
+
7
|
110
|
+
18
|
111
|
+
7
|
112
|
+
19
|
113
|
+
64
|
114
|
+
49
|
115
|
+
7
|
116
|
+
2
|
117
|
+
15
|
118
|
+
13
|
119
|
+
7
|
120
|
+
20
|
121
|
+
7
|
122
|
+
16
|
123
|
+
64
|
124
|
+
49
|
125
|
+
7
|
126
|
+
2
|
127
|
+
15
|
128
|
+
49
|
129
|
+
21
|
130
|
+
2
|
131
|
+
15
|
132
|
+
99
|
133
|
+
7
|
134
|
+
22
|
135
|
+
45
|
136
|
+
23
|
137
|
+
24
|
138
|
+
49
|
139
|
+
25
|
140
|
+
2
|
141
|
+
13
|
142
|
+
99
|
143
|
+
12
|
144
|
+
7
|
145
|
+
26
|
146
|
+
12
|
147
|
+
7
|
148
|
+
27
|
149
|
+
12
|
150
|
+
65
|
151
|
+
12
|
152
|
+
49
|
153
|
+
28
|
154
|
+
4
|
155
|
+
15
|
156
|
+
49
|
157
|
+
26
|
158
|
+
0
|
159
|
+
15
|
160
|
+
2
|
161
|
+
11
|
162
|
+
I
|
163
|
+
9
|
164
|
+
I
|
165
|
+
0
|
166
|
+
I
|
167
|
+
0
|
168
|
+
I
|
169
|
+
0
|
170
|
+
n
|
171
|
+
p
|
172
|
+
29
|
173
|
+
s
|
174
|
+
21
|
175
|
+
coderay/encoders/term
|
176
|
+
x
|
177
|
+
7
|
178
|
+
require
|
179
|
+
x
|
180
|
+
17
|
181
|
+
TERM_TOKEN_COLORS
|
182
|
+
x
|
183
|
+
4
|
184
|
+
Hash
|
185
|
+
x
|
186
|
+
16
|
187
|
+
new_from_literal
|
188
|
+
x
|
189
|
+
7
|
190
|
+
comment
|
191
|
+
s
|
192
|
+
4
|
193
|
+
1;36
|
194
|
+
x
|
195
|
+
3
|
196
|
+
[]=
|
197
|
+
x
|
198
|
+
15
|
199
|
+
global_variable
|
200
|
+
s
|
201
|
+
2
|
202
|
+
36
|
203
|
+
x
|
204
|
+
6
|
205
|
+
regexp
|
206
|
+
x
|
207
|
+
7
|
208
|
+
content
|
209
|
+
s
|
210
|
+
2
|
211
|
+
33
|
212
|
+
x
|
213
|
+
9
|
214
|
+
delimiter
|
215
|
+
s
|
216
|
+
4
|
217
|
+
1;29
|
218
|
+
x
|
219
|
+
8
|
220
|
+
modifier
|
221
|
+
s
|
222
|
+
2
|
223
|
+
35
|
224
|
+
x
|
225
|
+
8
|
226
|
+
function
|
227
|
+
x
|
228
|
+
8
|
229
|
+
reserved
|
230
|
+
s
|
231
|
+
4
|
232
|
+
1;32
|
233
|
+
x
|
234
|
+
6
|
235
|
+
symbol
|
236
|
+
x
|
237
|
+
9
|
238
|
+
const_set
|
239
|
+
x
|
240
|
+
8
|
241
|
+
Encoders
|
242
|
+
x
|
243
|
+
7
|
244
|
+
CodeRay
|
245
|
+
n
|
246
|
+
x
|
247
|
+
17
|
248
|
+
open_module_under
|
249
|
+
x
|
250
|
+
15
|
251
|
+
__module_init__
|
252
|
+
M
|
253
|
+
1
|
254
|
+
n
|
255
|
+
n
|
256
|
+
x
|
257
|
+
8
|
258
|
+
Encoders
|
259
|
+
i
|
260
|
+
31
|
261
|
+
5
|
262
|
+
66
|
263
|
+
99
|
264
|
+
7
|
265
|
+
0
|
266
|
+
45
|
267
|
+
1
|
268
|
+
2
|
269
|
+
65
|
270
|
+
49
|
271
|
+
3
|
272
|
+
3
|
273
|
+
13
|
274
|
+
99
|
275
|
+
12
|
276
|
+
7
|
277
|
+
4
|
278
|
+
12
|
279
|
+
7
|
280
|
+
5
|
281
|
+
12
|
282
|
+
65
|
283
|
+
12
|
284
|
+
49
|
285
|
+
6
|
286
|
+
4
|
287
|
+
15
|
288
|
+
49
|
289
|
+
4
|
290
|
+
0
|
291
|
+
11
|
292
|
+
I
|
293
|
+
6
|
294
|
+
I
|
295
|
+
0
|
296
|
+
I
|
297
|
+
0
|
298
|
+
I
|
299
|
+
0
|
300
|
+
n
|
301
|
+
p
|
302
|
+
7
|
303
|
+
x
|
304
|
+
4
|
305
|
+
Term
|
306
|
+
x
|
307
|
+
7
|
308
|
+
Encoder
|
309
|
+
n
|
310
|
+
x
|
311
|
+
10
|
312
|
+
open_class
|
313
|
+
x
|
314
|
+
14
|
315
|
+
__class_init__
|
316
|
+
M
|
317
|
+
1
|
318
|
+
n
|
319
|
+
n
|
320
|
+
x
|
321
|
+
4
|
322
|
+
Term
|
323
|
+
i
|
324
|
+
11
|
325
|
+
5
|
326
|
+
66
|
327
|
+
45
|
328
|
+
0
|
329
|
+
1
|
330
|
+
56
|
331
|
+
2
|
332
|
+
50
|
333
|
+
3
|
334
|
+
0
|
335
|
+
11
|
336
|
+
I
|
337
|
+
2
|
338
|
+
I
|
339
|
+
0
|
340
|
+
I
|
341
|
+
0
|
342
|
+
I
|
343
|
+
0
|
344
|
+
n
|
345
|
+
p
|
346
|
+
4
|
347
|
+
x
|
348
|
+
17
|
349
|
+
TERM_TOKEN_COLORS
|
350
|
+
n
|
351
|
+
M
|
352
|
+
1
|
353
|
+
p
|
354
|
+
2
|
355
|
+
x
|
356
|
+
9
|
357
|
+
for_block
|
358
|
+
t
|
359
|
+
n
|
360
|
+
x
|
361
|
+
4
|
362
|
+
Term
|
363
|
+
i
|
364
|
+
25
|
365
|
+
58
|
366
|
+
37
|
367
|
+
19
|
368
|
+
0
|
369
|
+
15
|
370
|
+
37
|
371
|
+
19
|
372
|
+
1
|
373
|
+
15
|
374
|
+
15
|
375
|
+
45
|
376
|
+
0
|
377
|
+
1
|
378
|
+
20
|
379
|
+
0
|
380
|
+
20
|
381
|
+
1
|
382
|
+
13
|
383
|
+
18
|
384
|
+
3
|
385
|
+
49
|
386
|
+
2
|
387
|
+
2
|
388
|
+
15
|
389
|
+
11
|
390
|
+
I
|
391
|
+
7
|
392
|
+
I
|
393
|
+
2
|
394
|
+
I
|
395
|
+
2
|
396
|
+
I
|
397
|
+
2
|
398
|
+
n
|
399
|
+
p
|
400
|
+
3
|
401
|
+
x
|
402
|
+
12
|
403
|
+
TOKEN_COLORS
|
404
|
+
n
|
405
|
+
x
|
406
|
+
3
|
407
|
+
[]=
|
408
|
+
p
|
409
|
+
5
|
410
|
+
I
|
411
|
+
0
|
412
|
+
I
|
413
|
+
10
|
414
|
+
I
|
415
|
+
a
|
416
|
+
I
|
417
|
+
11
|
418
|
+
I
|
419
|
+
19
|
420
|
+
x
|
421
|
+
70
|
422
|
+
/home/rocky-rvm/.rvm/src/rbx-trepanning/sample/rocky-trepanx-colors.rb
|
423
|
+
p
|
424
|
+
2
|
425
|
+
x
|
426
|
+
3
|
427
|
+
key
|
428
|
+
x
|
429
|
+
5
|
430
|
+
value
|
431
|
+
x
|
432
|
+
9
|
433
|
+
each_pair
|
434
|
+
p
|
435
|
+
3
|
436
|
+
I
|
437
|
+
2
|
438
|
+
I
|
439
|
+
10
|
440
|
+
I
|
441
|
+
b
|
442
|
+
x
|
443
|
+
70
|
444
|
+
/home/rocky-rvm/.rvm/src/rbx-trepanning/sample/rocky-trepanx-colors.rb
|
445
|
+
p
|
446
|
+
0
|
447
|
+
x
|
448
|
+
13
|
449
|
+
attach_method
|
450
|
+
p
|
451
|
+
3
|
452
|
+
I
|
453
|
+
2
|
454
|
+
I
|
455
|
+
f
|
456
|
+
I
|
457
|
+
1f
|
458
|
+
x
|
459
|
+
70
|
460
|
+
/home/rocky-rvm/.rvm/src/rbx-trepanning/sample/rocky-trepanx-colors.rb
|
461
|
+
p
|
462
|
+
0
|
463
|
+
x
|
464
|
+
13
|
465
|
+
attach_method
|
466
|
+
p
|
467
|
+
29
|
468
|
+
I
|
469
|
+
0
|
470
|
+
I
|
471
|
+
1
|
472
|
+
I
|
473
|
+
9
|
474
|
+
I
|
475
|
+
2
|
476
|
+
I
|
477
|
+
c
|
478
|
+
I
|
479
|
+
d
|
480
|
+
I
|
481
|
+
15
|
482
|
+
I
|
483
|
+
3
|
484
|
+
I
|
485
|
+
1f
|
486
|
+
I
|
487
|
+
4
|
488
|
+
I
|
489
|
+
29
|
490
|
+
I
|
491
|
+
5
|
492
|
+
I
|
493
|
+
2b
|
494
|
+
I
|
495
|
+
a
|
496
|
+
I
|
497
|
+
34
|
498
|
+
I
|
499
|
+
6
|
500
|
+
I
|
501
|
+
3e
|
502
|
+
I
|
503
|
+
7
|
504
|
+
I
|
505
|
+
48
|
506
|
+
I
|
507
|
+
8
|
508
|
+
I
|
509
|
+
52
|
510
|
+
I
|
511
|
+
9
|
512
|
+
I
|
513
|
+
60
|
514
|
+
I
|
515
|
+
b
|
516
|
+
I
|
517
|
+
6a
|
518
|
+
I
|
519
|
+
c
|
520
|
+
I
|
521
|
+
77
|
522
|
+
I
|
523
|
+
e
|
524
|
+
I
|
525
|
+
95
|
526
|
+
x
|
527
|
+
70
|
528
|
+
/home/rocky-rvm/.rvm/src/rbx-trepanning/sample/rocky-trepanx-colors.rb
|
529
|
+
p
|
530
|
+
0
|
data/test/data/quit2.cmd
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# ***************************************************
|
2
|
+
# This tests a stepping bug where lines looks like:
|
3
|
+
# #<Rubinius::Tuple: 0, 6, 0, 5, 16, 6, ...
|
4
|
+
# Note that line 6 and line 5 both start on offset 0
|
5
|
+
# ***************************************************
|
6
|
+
pr "HI"
|
7
|
+
next
|
8
|
+
next
|
9
|
+
next
|
10
|
+
next
|
11
|
+
# quit!
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# -*- Ruby -*-
|
3
|
+
# Are we rubinius? We'll test by checking the specific function we need.
|
4
|
+
raise RuntimeError, 'This package is for rubinius only!' unless
|
5
|
+
Object.constants.include?('Rubinius') &&
|
6
|
+
Rubinius.constants.include?('VM') &&
|
7
|
+
Rubinius::VM.respond_to?(:backtrace)
|
8
|
+
|
9
|
+
begin
|
10
|
+
require_relative 'lib/version'
|
11
|
+
puts 'Looks like you already have require_relative!'
|
12
|
+
exit 5
|
13
|
+
rescue NameError
|
14
|
+
end
|
data/test/integration/helper.rb
CHANGED
@@ -26,7 +26,7 @@ def run_debugger(testname, ruby_file, opts={})
|
|
26
26
|
rightfile = File.join(datadir, short_right)
|
27
27
|
|
28
28
|
short_cmd = "#{opts[:short_cmd] || testname}.cmd"
|
29
|
-
cmdfile = File.join(datadir, short_cmd)
|
29
|
+
cmdfile = opts[:cmdfile] || File.join(datadir, short_cmd)
|
30
30
|
outfile = opts[:outfile] ||
|
31
31
|
File.join(srcdir, "#{testname}.out")
|
32
32
|
programfile = ruby_file ? File.join(progdir, ruby_file) : ''
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require 'rubygems'; require 'require_relative'
|
4
|
+
require_relative 'helper'
|
5
|
+
|
6
|
+
class TestQuit < Test::Unit::TestCase
|
7
|
+
|
8
|
+
def NO__test_it
|
9
|
+
name = File.basename(__FILE__, '.rb')[5..-1]
|
10
|
+
no_error = run_debugger(name, 'step-bug.rb')
|
11
|
+
assert_equal(true, no_error)
|
12
|
+
if no_error
|
13
|
+
outfile = File.join(File.dirname(__FILE__), 'step-bug.out')
|
14
|
+
FileUtils.rm(outfile)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -6,6 +6,17 @@ require_relative 'helper'
|
|
6
6
|
class TestQuit < Test::Unit::TestCase
|
7
7
|
@@NAME = File.basename(__FILE__, '.rb')[5..-1]
|
8
8
|
|
9
|
+
# FIXME: causes rubinius to hang. Use
|
10
|
+
# rbx -Xagent.start -S rake
|
11
|
+
# to see backtrace
|
12
|
+
# def test_trepanx_set_confirm_off
|
13
|
+
# opts = {}
|
14
|
+
# opts[:filter] = Proc.new{|got_lines, correct_lines|
|
15
|
+
# got_lines[0] = "-> (null.rb:1 @0)\n"
|
16
|
+
# }
|
17
|
+
# assert_equal(true, run_debugger('quit2', 'null.rb', opts))
|
18
|
+
# end
|
19
|
+
|
9
20
|
def test_trepanx_call
|
10
21
|
opts = {}
|
11
22
|
opts[:filter] = Proc.new{|got_lines, correct_lines|
|
data/test/unit/test-app-util.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require 'rubygems'; require 'require_relative'
|
4
|
+
require_relative '../../processor/command/base/cmd'
|
5
|
+
|
6
|
+
class Trepan
|
7
|
+
class Command::Test < Trepan::Command
|
8
|
+
NAME = 'test'
|
9
|
+
CATEGORY = 'testcategory'
|
10
|
+
completion %w(a aa ab ba aac)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class TestBaseCommand < Test::Unit::TestCase
|
15
|
+
|
16
|
+
class MockCmdProcessor
|
17
|
+
# The below functions aren't tested/called, but they are the
|
18
|
+
# methods required by a command and are placeholders for when we
|
19
|
+
# do start testing.
|
20
|
+
def initialize(dbgr)
|
21
|
+
end
|
22
|
+
def confirm(message, default)
|
23
|
+
p ['confirm: ', message, default]
|
24
|
+
end
|
25
|
+
def errmsg(message, opts)
|
26
|
+
p ['err:', message, opts]
|
27
|
+
end
|
28
|
+
def msg(message, opts)
|
29
|
+
p [message, opts]
|
30
|
+
end
|
31
|
+
def msg_nocr(message, opts)
|
32
|
+
p ['nocr: ', message, opts]
|
33
|
+
end
|
34
|
+
def section(message, opts)
|
35
|
+
p ['section: ', message, opts]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def setup
|
40
|
+
@proc = MockCmdProcessor.new(nil)
|
41
|
+
@cmd = Trepan::Command::Test.new(@proc)
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_base_completion
|
45
|
+
assert_equal(%w(aa aac), @cmd.complete('aa'))
|
46
|
+
end
|
47
|
+
end
|
@@ -6,12 +6,12 @@ require_relative '../../processor/main'
|
|
6
6
|
require_relative '../../processor/command/exit'
|
7
7
|
require_relative '../../processor/command/base/subcmd'
|
8
8
|
|
9
|
-
# Mock debugger stub. FIXME: put in
|
9
|
+
# Mock debugger stub. FIXME: put in common helper routine.
|
10
10
|
class Trepan
|
11
11
|
end
|
12
12
|
|
13
13
|
$errors = []
|
14
|
-
class
|
14
|
+
class TestBaseSubCommand < Test::Unit::TestCase
|
15
15
|
|
16
16
|
Trepan::Subcommand.const_set(:NAME, 'bogus')
|
17
17
|
def setup
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'; require 'require_relative'
|
3
|
+
require_relative 'cmd-helper'
|
4
|
+
# We will use set as our canonical example
|
5
|
+
require_relative '../../processor/command/set'
|
6
|
+
|
7
|
+
class TestBaseSubcommandMgr < Test::Unit::TestCase
|
8
|
+
|
9
|
+
include UnitHelper
|
10
|
+
def setup
|
11
|
+
common_setup
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_basic
|
15
|
+
my_cmd = @cmds['show']
|
16
|
+
# require 'trepanning'; debugger
|
17
|
+
assert_equal(%w(debug different), my_cmd.complete('d'),
|
18
|
+
"Should be able to complete 'd'")
|
19
|
+
assert_equal(%w(show args), my_cmd.subcmds.lookup('ar').prefix,
|
20
|
+
"Should be able to complete lookup('ar')")
|
21
|
+
assert_equal(nil, my_cmd.subcmds.lookup('a'),
|
22
|
+
"Shouldn't find since we have 'show args' and 'show auto'")
|
23
|
+
end
|
24
|
+
end
|
data/test/unit/test-cmd-help.rb
CHANGED