aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/multibyte_chars_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/multibyte_chars_test.rb')
-rw-r--r--activesupport/test/multibyte_chars_test.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb
index e5ad9d26ee..63aff6eb99 100644
--- a/activesupport/test/multibyte_chars_test.rb
+++ b/activesupport/test/multibyte_chars_test.rb
@@ -139,14 +139,15 @@ class CharsTest < Test::Unit::TestCase
def test_resilience
assert_nothing_raised do
- assert_equal 1, @s[:bytes].chars.size, "There's only one valid utf-8 byte in the string"
+ assert_equal 5, @s[:bytes].chars.size, "The sequence contains five interpretable bytes"
end
+ reversed = [0xb8, 0x17e, 0x8, 0x2c6, 0xa5].reverse.pack('U*')
assert_nothing_raised do
- assert_equal "\010", @s[:bytes].chars.reverse, "There's only one valid utf-8 byte in the string"
+ assert_equal reversed, @s[:bytes].chars.reverse.to_s, "Reversing the string should only yield interpretable bytes"
end
assert_nothing_raised do
@s[:bytes].chars.reverse!
- assert_equal "\010", @s[:bytes], "There's only one valid utf-8 byte in the string"
+ assert_equal reversed, @s[:bytes].to_s, "Reversing the string should only yield interpretable bytes"
end
end