Skip to content

Commit 3a728f5

Browse files
committed
fix config append foo bar
`config append foo bar` doesn't work (it worked as `config set foo bar`).
1 parent 2db8846 commit 3a728f5

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

lib/debug/session.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ def config_command arg
11261126
config_set $1, $2, append: true
11271127

11281128
when /\A\s*append\s+(\w+)\s+(.+)\z/
1129-
config_set $1, $2
1129+
config_set $1, $2, append: true
11301130

11311131
when /\A(\w+)\z/
11321132
config_show $1

test/console/config_test.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,37 @@ def test_skip_path_skip_catch_breakpoint
276276
end
277277
end
278278

279+
class ConfigSetAppend < ConsoleTestCase
280+
def program
281+
<<~RUBY
282+
1| a = 1
283+
RUBY
284+
end
285+
286+
def test_set_append
287+
debug_code program do
288+
type 'config set skip_path foo'
289+
assert_line_text(/foo/)
290+
291+
type 'config set skip_path bar'
292+
assert_no_line_text(/foo/)
293+
assert_line_text(/bar/)
294+
295+
type 'config skip_path = foo'
296+
assert_no_line_text(/bar/)
297+
assert_line_text(/foo/)
298+
299+
type 'config append skip_path bar'
300+
assert_line_text(/foo.+bar/)
301+
302+
type 'config skip_path << baz'
303+
assert_line_text(/foo.+bar.+baz/)
304+
305+
type 'c'
306+
end
307+
end
308+
end
309+
279310
class ConfigKeepAllocSiteTest < ConsoleTestCase
280311
def program
281312
<<~RUBY

0 commit comments

Comments
 (0)