From 09b46c7dbea6ac2ac09ba4a41fae0bf628a775f3 Mon Sep 17 00:00:00 2001 From: Gourav Tiwari Date: Mon, 29 Jun 2015 20:20:50 +0000 Subject: Fixed slice! behavior: return nil for out-of-bound parameters --- activesupport/test/multibyte_chars_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/test/multibyte_chars_test.rb') diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb index e1c4b705f8..42829c6a8e 100644 --- a/activesupport/test/multibyte_chars_test.rb +++ b/activesupport/test/multibyte_chars_test.rb @@ -413,6 +413,10 @@ class MultibyteCharsUTF8BehaviourTest < ActiveSupport::TestCase assert_equal 'にち', @chars.slice!(1..2) end + def test_slice_bang_returns_nil_on_out_of_bound_arguments + assert_equal nil, @chars.mb_chars.slice!(9..10) + end + def test_slice_bang_removes_the_slice_from_the_receiver chars = 'úüù'.mb_chars chars.slice!(0,2) -- cgit v1.2.3