From 4b3e6cf1691da5a9c87ef4d55004f7ea8b3e383d Mon Sep 17 00:00:00 2001 From: ksss Date: Fri, 10 Mar 2017 13:26:15 +0900 Subject: Avoid infinity loop when empty string pattern --- test/t/string.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/t/string.rb b/test/t/string.rb index 442c95bf7..e39eefb60 100644 --- a/test/t/string.rb +++ b/test/t/string.rb @@ -365,6 +365,7 @@ assert('String#gsub', '15.2.10.5.18') do assert_equal('$$a$$', '##a##'.gsub('##'){|w| '$$' }, 'mruby/mruby#847 another case with block') assert_equal('A', 'a'.gsub('a', 'A')) assert_equal('A', 'a'.gsub('a'){|w| w.capitalize }) + assert_equal(".h.e.l.l.o.", "hello".gsub("", ".")) end assert('String#gsub with backslash') do -- cgit v1.2.3