aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/multibyte_handler_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/multibyte_handler_test.rb')
-rw-r--r--activesupport/test/multibyte_handler_test.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/test/multibyte_handler_test.rb b/activesupport/test/multibyte_handler_test.rb
index 7de3c0001e..06bc904c04 100644
--- a/activesupport/test/multibyte_handler_test.rb
+++ b/activesupport/test/multibyte_handler_test.rb
@@ -157,6 +157,8 @@ module UTF8HandlingTest
assert_equal nil, @handler.slice('', -1..1), "Broken range should return nil"
assert_equal '', @handler.slice('', 0..10), "Empty string should not break things"
assert_equal "d Блå ffi", @handler.slice(@string, 3..9), "Unicode characters have to be returned"
+ assert_equal "d Блå ffi", @handler.slice(@string, 3, 7), "Unicode characters have to be returned"
+ assert_equal "A", @handler.slice(@string, 0, 1), "Slicing from an offset should return characters"
assert_equal " Блå ffi ", @handler.slice(@string, 4..10), "Unicode characters have to be returned"
assert_equal "", @handler.slice(@string, 7..6), "Range is empty, should return an empty string"
assert_raise(ActiveSupport::Multibyte::Handlers::EncodingError) { @handler.slice(@bytestring, 2..3) }
@@ -266,4 +268,4 @@ class UTF8HandlingTestPure < Test::Unit::TestCase
common_setup
@handler = ::ActiveSupport::Multibyte::Handlers::UTF8Handler
end
-end \ No newline at end of file
+end