From edcae0237fef7ff8a5d524b80ff91c697843eb01 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 22 Feb 2008 06:52:54 +0000 Subject: * encoding.c (rb_enc_mbclen): return minlen instead of 1 when a character is not found properly. * string.c (rb_enc_strlen): round up string length with fixed multibyte encoding such as UTF-32. (rb_enc_strlen_cr): ditto. (rb_str_substr): fix substring with fixed multibyte encoding. (rb_str_justify): check number of characters. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_utf32.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/ruby/test_utf32.rb (limited to 'test/ruby') diff --git a/test/ruby/test_utf32.rb b/test/ruby/test_utf32.rb new file mode 100644 index 000000000..f81524f29 --- /dev/null +++ b/test/ruby/test_utf32.rb @@ -0,0 +1,27 @@ +require 'test/unit' + +class TestUTF32 < Test::Unit::TestCase + def encdump(str) + d = str.dump + if /\.force_encoding\("[A-Za-z0-9.:_+-]*"\)\z/ =~ d + d + else + "#{d}.force_encoding(#{str.encoding.name.dump})" + end + end + + def assert_str_equal(expected, actual, message=nil) + full_message = build_message(message, <