[ruby/irb] Fix broken history
command with -g
(https://github.com/ruby/irb/pull/1057) Local variable `grep` was always nil because the regular expression parsing options contained an unnecessary `\n`. `test_history_grep` did not detect this because it only asserted what was included in the output. https://github.com/ruby/irb/commit/a282bbc0cf
This commit is contained in:
parent
a33c944ba8
commit
3650f2460f
@ -14,7 +14,7 @@ module IRB
|
||||
|
||||
def execute(arg)
|
||||
|
||||
if (match = arg&.match(/(-g|-G)\s+(?<grep>.+)\s*\n\z/))
|
||||
if (match = arg&.match(/(-g|-G)\s+(?<grep>.+)\s*\z/))
|
||||
grep = Regexp.new(match[:grep])
|
||||
end
|
||||
|
||||
|
@ -972,6 +972,12 @@ module TestIRB
|
||||
puts x
|
||||
...
|
||||
EOF
|
||||
assert_not_include(out, <<~EOF)
|
||||
foo
|
||||
EOF
|
||||
assert_not_include(out, <<~EOF)
|
||||
bar
|
||||
EOF
|
||||
assert_empty err
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user