File tree 2 files changed +58
-20
lines changed
2 files changed +58
-20
lines changed Original file line number Diff line number Diff line change @@ -1079,13 +1079,13 @@ def wait_next_action_
1079
1079
when :up
1080
1080
if @current_frame_index + 1 < @target_frames . size
1081
1081
@current_frame_index += 1
1082
- show_src max_lines : 1
1082
+ show_src
1083
1083
show_frame ( @current_frame_index )
1084
1084
end
1085
1085
when :down
1086
1086
if @current_frame_index > 0
1087
1087
@current_frame_index -= 1
1088
- show_src max_lines : 1
1088
+ show_src
1089
1089
show_frame ( @current_frame_index )
1090
1090
end
1091
1091
when :set
Original file line number Diff line number Diff line change @@ -72,21 +72,28 @@ def test_config_show_frames_set
72
72
class ShowSrcLinesTest < ConsoleTestCase
73
73
def program
74
74
<<~RUBY
75
- 1| p 1
76
- 2| p 2
77
- 3| p 3
78
- 4| p 4
79
- 5| p 5
80
- 6| p 6
81
- 7| p 7
82
- 8| p 8
83
- 9| p 9
84
- 10| binding.b
85
- 11| p 11
86
- 12| p 12
87
- 13| p 13
88
- 14| p 14
89
- 15| p 15
75
+ 1| class Foo
76
+ 2| def self.a
77
+ 3| p 1
78
+ 4| p 2
79
+ 5| p 3
80
+ 6| p 3
81
+ 7| p 5
82
+ 8| p 6
83
+ 9| p 7
84
+ 10| p 8
85
+ 11| p 9
86
+ 12| p 10
87
+ 13| b
88
+ 14| end
89
+ 15|
90
+ 16| def self.b
91
+ 17| binding.b
92
+ 18| p 11
93
+ 19| end
94
+ 20| end
95
+ 21|
96
+ 22| Foo.a
90
97
RUBY
91
98
end
92
99
@@ -95,11 +102,42 @@ def test_show_src_lines_control_the_lines_displayed_on_breakpoint
95
102
type 'config set show_src_lines 2'
96
103
type 'continue'
97
104
assert_line_text ( [
98
- /9| p 9 / ,
99
- /=> 10| binding.b/
105
+ /16 \| def self \. b / ,
106
+ /=> 17 \| binding\ . b/
100
107
] )
108
+ assert_no_line_text ( /15\| / )
109
+ assert_no_line_text ( /18\| / )
110
+ type 'continue'
111
+ end
112
+ end
101
113
102
- assert_no_line_text ( /p 11/ )
114
+ def test_show_src_lines_control_the_lines_displayed_on_up
115
+ debug_code ( program ) do
116
+ type 'config set show_src_lines 2'
117
+ type 'continue'
118
+ type 'up'
119
+ assert_line_text ( [
120
+ /12\| p 10/ ,
121
+ /=> 13\| b/ ,
122
+ ] )
123
+ assert_no_line_text ( /11\| / )
124
+ assert_no_line_text ( /14\| / )
125
+ type 'continue'
126
+ end
127
+ end
128
+
129
+ def test_show_src_lines_control_the_lines_displayed_on_down
130
+ debug_code ( program ) do
131
+ type 'config set show_src_lines 2'
132
+ type 'continue'
133
+ type 'up'
134
+ type 'down'
135
+ assert_line_text ( [
136
+ /16\| def self\. b/ ,
137
+ /=> 17\| binding\. b/
138
+ ] )
139
+ assert_no_line_text ( /15\| / )
140
+ assert_no_line_text ( /18\| / )
103
141
type 'continue'
104
142
end
105
143
end
You can’t perform that action at this time.
0 commit comments