byebug 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +1 -1
- data/bin/byebug +1 -2
- data/byebug.gemspec +1 -1
- data/ext/byebug/byebug.c +50 -35
- data/ext/byebug/context.c +99 -45
- data/lib/byebug.rb +5 -10
- data/lib/byebug/command.rb +20 -12
- data/lib/byebug/commands/breakpoints.rb +1 -1
- data/lib/byebug/commands/control.rb +14 -21
- data/lib/byebug/commands/display.rb +4 -4
- data/lib/byebug/commands/enable.rb +20 -19
- data/lib/byebug/commands/eval.rb +1 -1
- data/lib/byebug/commands/finish.rb +4 -5
- data/lib/byebug/commands/info.rb +118 -116
- data/lib/byebug/commands/list.rb +72 -48
- data/lib/byebug/commands/reload.rb +4 -3
- data/lib/byebug/commands/set.rb +7 -16
- data/lib/byebug/commands/show.rb +2 -2
- data/lib/byebug/commands/threads.rb +7 -6
- data/lib/byebug/context.rb +10 -2
- data/lib/byebug/helper.rb +3 -3
- data/lib/byebug/processor.rb +1 -1
- data/lib/byebug/version.rb +1 -1
- data/old_doc/byebug.texi +45 -51
- data/test/breakpoints_test.rb +180 -195
- data/test/display_test.rb +59 -53
- data/test/eval_test.rb +0 -2
- data/test/examples/info.rb +5 -5
- data/test/examples/info_threads.rb +1 -1
- data/test/finish_test.rb +16 -15
- data/test/info_test.rb +9 -10
- data/test/irb_test.rb +64 -65
- data/test/list_test.rb +76 -50
- data/test/method_test.rb +10 -5
- data/test/post_mortem_test.rb +27 -25
- data/test/reload_test.rb +31 -31
- data/test/restart_test.rb +106 -110
- data/test/show_test.rb +8 -16
- data/test/stepping_test.rb +4 -2
- data/test/support/test_dsl.rb +37 -76
- data/test/test_helper.rb +0 -1
- data/test/variables_test.rb +9 -12
- metadata +4 -4
data/test/breakpoints_test.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
require_relative 'test_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe 'Breakpoints' do
|
4
4
|
include TestDsl
|
5
5
|
|
6
|
-
describe
|
6
|
+
describe 'setting breakpoint in the current file' do
|
7
7
|
before { enter 'break 10' }
|
8
8
|
subject { Byebug.breakpoints.first }
|
9
9
|
|
10
10
|
def check_subject(field, value)
|
11
|
-
debug_file(
|
11
|
+
debug_file('breakpoint1') { subject.send(field).must_equal value }
|
12
12
|
end
|
13
13
|
|
14
|
-
it(
|
15
|
-
it(
|
16
|
-
check_subject(:source, fullpath(
|
17
|
-
it(
|
18
|
-
it(
|
19
|
-
it(
|
20
|
-
it(
|
21
|
-
it(
|
14
|
+
it('must have correct pos') { check_subject(:pos, 10) }
|
15
|
+
it('must have correct source') {
|
16
|
+
check_subject(:source, fullpath('breakpoint1')) }
|
17
|
+
it('must have correct expression') { check_subject(:expr, nil) }
|
18
|
+
it('must have correct hit count') { check_subject(:hit_count, 0) }
|
19
|
+
it('must have correct hit value') { check_subject(:hit_value, 0) }
|
20
|
+
it('must be enabled') { check_subject(:enabled?, true) }
|
21
|
+
it('must return right response') do
|
22
22
|
id = nil
|
23
23
|
debug_file('breakpoint1') { id = subject.id }
|
24
24
|
check_output_includes \
|
@@ -26,22 +26,22 @@ describe "Breakpoints" do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
describe
|
29
|
+
describe 'using shortcut for the command' do
|
30
30
|
before { enter 'b 10' }
|
31
|
-
it
|
32
|
-
debug_file(
|
31
|
+
it 'must set a breakpoint' do
|
32
|
+
debug_file('breakpoint1') { Byebug.breakpoints.size.must_equal 1 }
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
describe
|
36
|
+
describe 'setting breakpoint to unexistent line' do
|
37
37
|
before { enter 'break 100' }
|
38
38
|
|
39
|
-
it
|
40
|
-
debug_file(
|
39
|
+
it 'must not create a breakpoint' do
|
40
|
+
debug_file('breakpoint1') { Byebug.breakpoints.must_be_empty }
|
41
41
|
end
|
42
42
|
|
43
|
-
it
|
44
|
-
debug_file(
|
43
|
+
it 'must show an error' do
|
44
|
+
debug_file('breakpoint1')
|
45
45
|
check_output_includes \
|
46
46
|
"There are only #{LineCache.size(fullpath('breakpoint1'))} lines in" \
|
47
47
|
" file #{fullpath('breakpoint1')}", interface.error_queue
|
@@ -49,74 +49,64 @@ describe "Breakpoints" do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
|
52
|
-
describe
|
52
|
+
describe 'setting breakpoint to incorrect line' do
|
53
53
|
before { enter 'break 11' }
|
54
54
|
|
55
|
-
it
|
56
|
-
debug_file(
|
55
|
+
it 'must not create a breakpoint' do
|
56
|
+
debug_file('breakpoint1') { Byebug.breakpoints.must_be_empty }
|
57
57
|
end
|
58
58
|
|
59
|
-
it
|
60
|
-
debug_file(
|
59
|
+
it 'must show an error' do
|
60
|
+
debug_file('breakpoint1')
|
61
61
|
check_output_includes \
|
62
62
|
"Line 11 is not a stopping point in file #{fullpath('breakpoint1')}",
|
63
63
|
interface.error_queue
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
describe
|
68
|
-
it
|
67
|
+
describe 'stopping at breakpoint' do
|
68
|
+
it 'must stop at the correct line' do
|
69
69
|
enter 'break 14', 'cont'
|
70
|
-
debug_file(
|
70
|
+
debug_file('breakpoint1') { state.line.must_equal 14 }
|
71
71
|
end
|
72
72
|
|
73
|
-
it
|
73
|
+
it 'must stop at the correct file' do
|
74
74
|
enter 'break 14', 'cont'
|
75
|
-
debug_file(
|
76
|
-
state.file.must_equal fullpath(
|
75
|
+
debug_file('breakpoint1') {
|
76
|
+
state.file.must_equal fullpath('breakpoint1') }
|
77
77
|
end
|
78
78
|
|
79
|
-
describe
|
80
|
-
|
81
|
-
@old_hashes = {}
|
82
|
-
set_tmp_hash(Byebug::Command.settings, :basename, false)
|
83
|
-
@id = nil
|
84
|
-
end
|
85
|
-
|
86
|
-
after do
|
87
|
-
restore_tmp_hash(Byebug::Command.settings, :basename)
|
88
|
-
end
|
89
|
-
|
90
|
-
it "must show a message with full filename" do
|
79
|
+
describe 'show a message' do
|
80
|
+
it 'must show a message with full filename' do
|
91
81
|
enter 'break 14', 'cont'
|
92
|
-
debug_file(
|
82
|
+
debug_file('breakpoint1') { @id = Byebug.breakpoints.first.id }
|
93
83
|
check_output_includes \
|
94
84
|
"Created breakpoint #{@id} at #{fullpath('breakpoint1')}:14"
|
95
85
|
end
|
96
86
|
|
97
|
-
it
|
87
|
+
it 'must show a message with basename' do
|
98
88
|
enter 'set basename', 'break 14', 'cont'
|
99
|
-
debug_file(
|
89
|
+
debug_file('breakpoint1') { @id = Byebug.breakpoints.first.id }
|
100
90
|
check_output_includes "Created breakpoint #{@id} at breakpoint1.rb:14"
|
101
91
|
end
|
102
92
|
end
|
103
93
|
end
|
104
94
|
|
105
|
-
describe
|
106
|
-
it
|
95
|
+
describe 'reloading source on change' do
|
96
|
+
it 'must not reload source if autoreload is not set' do
|
107
97
|
id = nil
|
108
98
|
enter \
|
109
99
|
'set noautoreload',
|
110
100
|
->{change_line_in_file(fullpath('breakpoint1'), 14, ''); 'break 14'},
|
111
101
|
->{change_line_in_file(fullpath('breakpoint1'), 14, 'c = a + b');
|
112
102
|
'cont'}
|
113
|
-
debug_file(
|
103
|
+
debug_file('breakpoint1') { id = Byebug.breakpoints.first.id }
|
114
104
|
check_output_includes \
|
115
105
|
"Created breakpoint #{id} at #{fullpath('breakpoint1')}:14"
|
116
106
|
end
|
117
107
|
|
118
|
-
it
|
119
|
-
enter
|
108
|
+
it 'must reload source if autoreload is set' do
|
109
|
+
enter \
|
120
110
|
'set autoreload',
|
121
111
|
->{change_line_in_file(fullpath('breakpoint1'), 14, ''); 'break 14'},
|
122
112
|
# Setting second breakpoint just to reload the source code after rolling
|
@@ -124,269 +114,264 @@ describe "Breakpoints" do
|
|
124
114
|
->{change_line_in_file(fullpath('breakpoint1'), 14, 'c = a + b');
|
125
115
|
'break 15'},
|
126
116
|
'cont'
|
127
|
-
|
128
|
-
debug_file "breakpoint1"
|
117
|
+
debug_file 'breakpoint1'
|
129
118
|
check_output_includes \
|
130
119
|
"Line 14 is not a stopping point in file #{fullpath('breakpoint1')}",
|
131
120
|
interface.error_queue
|
132
121
|
end
|
133
122
|
end
|
134
123
|
|
135
|
-
describe
|
136
|
-
describe
|
137
|
-
before
|
138
|
-
enter "break #{fullpath('breakpoint2')}:3", 'cont'
|
139
|
-
end
|
124
|
+
describe 'set breakpoint in a file' do
|
125
|
+
describe 'successfully' do
|
126
|
+
before { enter "break #{fullpath('breakpoint2')}:3", 'cont' }
|
140
127
|
|
141
|
-
it
|
142
|
-
debug_file(
|
128
|
+
it 'must stop at the correct line' do
|
129
|
+
debug_file('breakpoint1') { state.line.must_equal 3 }
|
143
130
|
end
|
144
131
|
|
145
|
-
it
|
146
|
-
debug_file(
|
147
|
-
state.file.must_equal fullpath(
|
132
|
+
it 'must stop at the correct file' do
|
133
|
+
debug_file('breakpoint1') {
|
134
|
+
state.file.must_equal fullpath('breakpoint2') }
|
148
135
|
end
|
149
136
|
end
|
150
137
|
|
151
|
-
describe
|
138
|
+
describe 'when setting breakpoint to unexisted file' do
|
152
139
|
before do
|
153
|
-
enter
|
154
|
-
debug_file(
|
140
|
+
enter 'break asf:324'
|
141
|
+
debug_file('breakpoint1')
|
155
142
|
end
|
156
|
-
it
|
157
|
-
check_output_includes
|
143
|
+
it 'must show an error' do
|
144
|
+
check_output_includes 'No source file named asf', interface.error_queue
|
158
145
|
end
|
159
146
|
|
160
|
-
it
|
147
|
+
it 'must ask about setting breakpoint anyway' do
|
161
148
|
check_output_includes \
|
162
|
-
|
149
|
+
'Set breakpoint anyway? (y/n)', interface.confirm_queue
|
163
150
|
end
|
164
151
|
end
|
165
152
|
end
|
166
153
|
|
167
|
-
describe
|
168
|
-
describe
|
169
|
-
before
|
170
|
-
enter 'break A#b', 'cont'
|
171
|
-
end
|
154
|
+
describe 'set breakpoint to a method' do
|
155
|
+
describe 'set breakpoint to an instance method' do
|
156
|
+
before { enter 'break A#b', 'cont' }
|
172
157
|
|
173
|
-
it
|
174
|
-
debug_file(
|
158
|
+
it 'must stop at the correct line' do
|
159
|
+
debug_file('breakpoint1') { state.line.must_equal 5 }
|
175
160
|
end
|
176
161
|
|
177
|
-
it
|
178
|
-
debug_file(
|
179
|
-
state.file.must_equal fullpath(
|
162
|
+
it 'must stop at the correct file' do
|
163
|
+
debug_file('breakpoint1') {
|
164
|
+
state.file.must_equal fullpath('breakpoint1') }
|
180
165
|
end
|
181
166
|
end
|
182
167
|
|
183
|
-
describe
|
184
|
-
before
|
185
|
-
enter 'break A.a', 'cont'
|
186
|
-
end
|
168
|
+
describe 'set breakpoint to a class method' do
|
169
|
+
before { enter 'break A.a', 'cont' }
|
187
170
|
|
188
|
-
it
|
189
|
-
debug_file(
|
171
|
+
it 'must stop at the correct line' do
|
172
|
+
debug_file('breakpoint1') { state.line.must_equal 2 }
|
190
173
|
end
|
191
174
|
|
192
|
-
it
|
193
|
-
debug_file(
|
194
|
-
state.file.must_equal fullpath(
|
175
|
+
it 'must stop at the correct file' do
|
176
|
+
debug_file('breakpoint1') {
|
177
|
+
state.file.must_equal fullpath('breakpoint1') }
|
195
178
|
end
|
196
179
|
end
|
197
180
|
|
198
|
-
describe
|
199
|
-
it
|
200
|
-
enter
|
201
|
-
debug_file(
|
202
|
-
check_output_includes
|
181
|
+
describe 'set breakpoint to unexisted class' do
|
182
|
+
it 'must show an error' do
|
183
|
+
enter 'break B.a'
|
184
|
+
debug_file('breakpoint1')
|
185
|
+
check_output_includes 'Unknown class B.', interface.error_queue
|
203
186
|
end
|
204
187
|
end
|
205
188
|
end
|
206
189
|
|
207
|
-
describe
|
208
|
-
before { enter
|
190
|
+
describe 'set breakpoint to an invalid location' do
|
191
|
+
before { enter 'break foo' }
|
209
192
|
|
210
|
-
it
|
211
|
-
debug_file(
|
193
|
+
it 'must not create a breakpoint' do
|
194
|
+
debug_file('breakpoint1') { Byebug.breakpoints.must_be_empty }
|
212
195
|
end
|
213
196
|
|
214
|
-
it
|
215
|
-
debug_file(
|
197
|
+
it 'must show an error' do
|
198
|
+
debug_file('breakpoint1')
|
216
199
|
check_output_includes \
|
217
200
|
'Invalid breakpoint location: foo.', interface.error_queue
|
218
201
|
end
|
219
202
|
end
|
220
203
|
|
221
|
-
describe
|
222
|
-
describe
|
223
|
-
before { enter
|
204
|
+
describe 'disabling a breakpoint' do
|
205
|
+
describe 'successfully' do
|
206
|
+
before { enter 'break 14' }
|
207
|
+
|
208
|
+
describe 'short syntax' do
|
209
|
+
before { enter ->{"disable #{Byebug.breakpoints.first.id}"},
|
210
|
+
'break 15' }
|
224
211
|
|
225
|
-
|
226
|
-
|
227
|
-
it "must have a breakpoint with #enabled? returning false" do
|
228
|
-
debug_file("breakpoint1") {
|
212
|
+
it 'must have a breakpoint with #enabled? returning false' do
|
213
|
+
debug_file('breakpoint1') {
|
229
214
|
Byebug.breakpoints.first.enabled?.must_equal false }
|
230
215
|
end
|
231
216
|
|
232
|
-
it
|
233
|
-
enter
|
234
|
-
debug_file(
|
217
|
+
it 'must not stop on the disabled breakpoint' do
|
218
|
+
enter 'cont'
|
219
|
+
debug_file('breakpoint1') { state.line.must_equal 15 }
|
235
220
|
end
|
236
221
|
end
|
237
222
|
|
238
|
-
describe
|
223
|
+
describe 'full syntax' do
|
239
224
|
before { enter ->{"disable breakpoints #{Byebug.breakpoints.first.id}"},
|
240
|
-
|
241
|
-
|
242
|
-
|
225
|
+
'break 15' }
|
226
|
+
|
227
|
+
it 'must have a breakpoint with #enabled? returning false' do
|
228
|
+
debug_file('breakpoint1') {
|
243
229
|
Byebug.breakpoints.first.enabled?.must_equal false }
|
244
230
|
end
|
245
231
|
end
|
246
232
|
end
|
247
233
|
|
248
|
-
describe
|
249
|
-
it
|
250
|
-
enter
|
251
|
-
debug_file(
|
234
|
+
describe 'errors' do
|
235
|
+
it 'must show an error if syntax is incorrect' do
|
236
|
+
enter 'disable'
|
237
|
+
debug_file('breakpoint1')
|
252
238
|
check_output_includes \
|
253
|
-
'"disable" must be followed "display", "breakpoints" or
|
254
|
-
'numbers.', interface.error_queue
|
239
|
+
'"disable" must be followed by "display", "breakpoints" or ' \
|
240
|
+
'breakpoint numbers.', interface.error_queue
|
255
241
|
|
256
242
|
end
|
257
243
|
|
258
|
-
it
|
259
|
-
enter
|
260
|
-
debug_file(
|
244
|
+
it 'must show an error if no breakpoints is set' do
|
245
|
+
enter 'disable 1'
|
246
|
+
debug_file('breakpoint1')
|
261
247
|
check_output_includes \
|
262
248
|
'No breakpoints have been set.', interface.error_queue
|
263
249
|
end
|
264
250
|
|
265
|
-
it
|
266
|
-
"
|
267
|
-
enter
|
268
|
-
debug_file(
|
251
|
+
it 'must show an error if not a number is provided as an argument to ' \
|
252
|
+
' "disable" command' do
|
253
|
+
enter 'break 14', 'disable foo'
|
254
|
+
debug_file('breakpoint1')
|
269
255
|
check_output_includes \
|
270
|
-
|
256
|
+
'Disable breakpoints argument "foo" needs to be a number.'
|
271
257
|
end
|
272
258
|
end
|
273
259
|
end
|
274
260
|
|
275
|
-
describe
|
261
|
+
describe 'enabling a breakpoint' do
|
276
262
|
|
277
|
-
describe
|
278
|
-
before { enter
|
263
|
+
describe 'successfully' do
|
264
|
+
before { enter 'break 14' }
|
279
265
|
|
280
|
-
describe
|
281
|
-
before { enter ->{"enable #{Byebug.breakpoints.first.id}"},
|
266
|
+
describe 'short syntax' do
|
267
|
+
before { enter ->{"enable #{Byebug.breakpoints.first.id}"}, 'break 15' }
|
282
268
|
|
283
|
-
it
|
284
|
-
debug_file(
|
269
|
+
it 'must have a breakpoint with #enabled? returning true' do
|
270
|
+
debug_file('breakpoint1') {
|
285
271
|
Byebug.breakpoints.first.enabled?.must_equal true }
|
286
272
|
end
|
287
273
|
|
288
|
-
it
|
289
|
-
enter
|
290
|
-
debug_file(
|
274
|
+
it 'must stop on the enabled breakpoint' do
|
275
|
+
enter 'cont'
|
276
|
+
debug_file('breakpoint1') { state.line.must_equal 14 }
|
291
277
|
end
|
292
278
|
end
|
293
279
|
|
294
|
-
describe
|
280
|
+
describe 'full syntax' do
|
295
281
|
before { enter ->{"enable breakpoints #{Byebug.breakpoints.first.id}"},
|
296
|
-
|
282
|
+
'break 15' }
|
297
283
|
|
298
|
-
it
|
299
|
-
debug_file(
|
284
|
+
it 'must have a breakpoint with #enabled? returning true' do
|
285
|
+
debug_file('breakpoint1') {
|
300
286
|
Byebug.breakpoints.first.enabled?.must_equal true }
|
301
287
|
end
|
302
288
|
end
|
303
289
|
end
|
304
290
|
|
305
|
-
describe
|
306
|
-
it
|
307
|
-
enter
|
308
|
-
debug_file(
|
309
|
-
check_output_includes
|
310
|
-
'"breakpoints" or
|
291
|
+
describe 'errors' do
|
292
|
+
it 'must show an error if syntax is incorrect' do
|
293
|
+
enter 'enable'
|
294
|
+
debug_file('breakpoint1')
|
295
|
+
check_output_includes \
|
296
|
+
'"enable" must be followed by "display", "breakpoints" or ' \
|
297
|
+
'breakpoint numbers.', interface.error_queue
|
311
298
|
end
|
312
299
|
end
|
313
300
|
end
|
314
301
|
|
315
|
-
describe
|
316
|
-
before { enter
|
317
|
-
|
302
|
+
describe 'deleting a breakpoint' do
|
303
|
+
before { enter 'break 14', ->{"delete #{Byebug.breakpoints.first.id}"},
|
304
|
+
'break 15' }
|
318
305
|
|
319
|
-
it
|
320
|
-
debug_file(
|
306
|
+
it 'must have only one breakpoint' do
|
307
|
+
debug_file('breakpoint1') { Byebug.breakpoints.size.must_equal 1 }
|
321
308
|
end
|
322
309
|
|
323
|
-
it
|
324
|
-
enter
|
325
|
-
debug_file(
|
310
|
+
it 'must not stop on the disabled breakpoint' do
|
311
|
+
enter 'cont'
|
312
|
+
debug_file('breakpoint1') { state.line.must_equal 15 }
|
326
313
|
end
|
327
314
|
end
|
328
315
|
|
329
|
-
describe
|
330
|
-
it
|
331
|
-
enter
|
332
|
-
debug_file(
|
316
|
+
describe 'Conditional breakpoints' do
|
317
|
+
it 'must stop if the condition is true' do
|
318
|
+
enter 'break 14 if b == 5', 'break 15', 'cont'
|
319
|
+
debug_file('breakpoint1') { state.line.must_equal 14 }
|
333
320
|
end
|
334
321
|
|
335
|
-
it
|
336
|
-
enter
|
337
|
-
debug_file(
|
322
|
+
it 'must skip if the condition is false' do
|
323
|
+
enter 'break 14 if b == 3', 'break 15', 'cont'
|
324
|
+
debug_file('breakpoint1') { state.line.must_equal 15 }
|
338
325
|
end
|
339
326
|
|
340
|
-
it
|
341
|
-
enter
|
342
|
-
debug_file(
|
327
|
+
it 'must show an error when conditional syntax is wrong' do
|
328
|
+
enter 'break 14 ifa b == 3', 'break 15', 'cont'
|
329
|
+
debug_file('breakpoint1') { state.line.must_equal 15 }
|
343
330
|
check_output_includes \
|
344
|
-
|
331
|
+
'Expecting "if" in breakpoint condition; got: ifa b == 3.',
|
345
332
|
interface.error_queue
|
346
333
|
end
|
347
334
|
|
348
|
-
describe
|
349
|
-
before
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
->{"cond #{Byebug.breakpoints.first.id} b -=( 3"},
|
354
|
-
->{"enable #{Byebug.breakpoints.first.id}"}
|
355
|
-
)
|
356
|
-
end
|
335
|
+
describe 'enabling with wrong conditional syntax' do
|
336
|
+
before { enter 'break 14',
|
337
|
+
->{"disable #{Byebug.breakpoints.first.id}"},
|
338
|
+
->{"cond #{Byebug.breakpoints.first.id} b -=( 3"},
|
339
|
+
->{"enable #{Byebug.breakpoints.first.id}"} }
|
357
340
|
|
358
|
-
it
|
359
|
-
debug_file(
|
341
|
+
it 'must not enable a breakpoint' do
|
342
|
+
debug_file('breakpoint1') {
|
360
343
|
Byebug.breakpoints.first.enabled?.must_equal false }
|
361
344
|
end
|
362
345
|
|
363
|
-
it
|
364
|
-
debug_file(
|
365
|
-
check_output_includes
|
366
|
-
'breakpoint remains
|
346
|
+
it 'must show an error' do
|
347
|
+
debug_file('breakpoint1')
|
348
|
+
check_output_includes \
|
349
|
+
'Expression "b -=( 3" syntactically incorrect; breakpoint remains ' \
|
350
|
+
'disabled.', interface.error_queue
|
367
351
|
end
|
368
352
|
end
|
369
353
|
|
370
|
-
it
|
371
|
-
enter
|
372
|
-
debug_file(
|
354
|
+
it 'must show an error if no file or line is specified' do
|
355
|
+
enter 'break ifa b == 3', 'break 15', 'cont'
|
356
|
+
debug_file('breakpoint1') { state.line.must_equal 15 }
|
373
357
|
check_output_includes \
|
374
|
-
|
358
|
+
'Invalid breakpoint location: ifa b == 3.', interface.error_queue
|
375
359
|
end
|
376
360
|
|
377
|
-
it
|
378
|
-
enter
|
379
|
-
debug_file(
|
380
|
-
check_output_includes
|
381
|
-
'breakpoint disabled.',
|
361
|
+
it 'must show an error if expression syntax is invalid' do
|
362
|
+
enter 'break if b -=) 3', 'break 15', 'cont'
|
363
|
+
debug_file('breakpoint1') { state.line.must_equal 15 }
|
364
|
+
check_output_includes \
|
365
|
+
'Expression "b -=) 3" syntactically incorrect; breakpoint disabled.',
|
366
|
+
interface.error_queue
|
382
367
|
end
|
383
368
|
end
|
384
369
|
|
385
|
-
describe
|
386
|
-
it
|
387
|
-
skip(
|
388
|
-
|
389
|
-
|
370
|
+
describe 'Post Mortem' do
|
371
|
+
it 'must be able to set breakpoints in post-mortem mode' do
|
372
|
+
skip('No post morten mode for now')
|
373
|
+
enter 'cont', 'break 12', 'cont'
|
374
|
+
debug_file('post_mortem') { state.line.must_equal 12 }
|
390
375
|
end
|
391
376
|
end
|
392
377
|
|