aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_regexp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r--test/ruby/test_regexp.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 5982d23e1f..7937fe8867 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -500,6 +500,12 @@ class TestRegexp < Test::Unit::TestCase
assert_equal('foo[\z]baz', "foobarbaz".sub!(/(b..)/, '[\z]'))
end
+ def test_regsub_K
+ bug8856 = '[ruby-dev:47694] [Bug #8856]'
+ result = "foobarbazquux/foobarbazquux".gsub(/foo\Kbar/, "")
+ assert_equal('foobazquux/foobazquux', result, bug8856)
+ end
+
def test_KCODE
assert_nil($KCODE)
assert_nothing_raised { $KCODE = nil }