From 9fecb199a16b634312059f187ebec1d23655d96e Mon Sep 17 00:00:00 2001 From: Tim Craft Date: Mon, 26 Aug 2024 14:00:44 +0100 Subject: [PATCH] Expand Regexp.quote spec to cover dollar sign characters --- core/regexp/shared/quote.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/regexp/shared/quote.rb b/core/regexp/shared/quote.rb index b5ecc35f0..48179444f 100644 --- a/core/regexp/shared/quote.rb +++ b/core/regexp/shared/quote.rb @@ -2,8 +2,8 @@ describe :regexp_quote, shared: true do it "escapes any characters with special meaning in a regular expression" do - Regexp.send(@method, '\*?{}.+^[]()- ').should == '\\\\\*\?\{\}\.\+\^\[\]\(\)\-\\ ' - Regexp.send(@method, "\*?{}.+^[]()- ").should == '\\*\\?\\{\\}\\.\\+\\^\\[\\]\\(\\)\\-\\ ' + Regexp.send(@method, '\*?{}.+^$[]()- ').should == '\\\\\*\?\{\}\.\+\^\$\[\]\(\)\-\\ ' + Regexp.send(@method, "\*?{}.+^$[]()- ").should == '\\*\\?\\{\\}\\.\\+\\^\\$\\[\\]\\(\\)\\-\\ ' Regexp.send(@method, '\n\r\f\t').should == '\\\\n\\\\r\\\\f\\\\t' Regexp.send(@method, "\n\r\f\t").should == '\\n\\r\\f\\t' end