summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_m17n.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index f5f23c09f1..b9b85b2129 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -229,6 +229,7 @@ class TestM17N < Test::Unit::TestCase
STR_WITHOUT_BOM = "\u3042".freeze
STR_WITH_BOM = "\uFEFF\u3042".freeze
bug8940 = '[ruby-core:59757] [Bug #8940]'
+ bug9415 = '[ruby-dev:47895] [Bug #9415]'
%w/UTF-16 UTF-32/.each do |enc|
%w/BE LE/.each do |endian|
bom = "\uFEFF".encode("#{enc}#{endian}").force_encoding(enc)
@@ -242,6 +243,14 @@ class TestM17N < Test::Unit::TestCase
assert_normal_exit("#{bom.b.dump}.force_encoding('#{enc}').inspect", bug8940)
end
+ define_method("test_utf_16_32_codepoints(#{enc}#{endian})") do
+ assert_equal([0xFEFF], bom.codepoints, bug9415)
+ end
+
+ define_method("test_utf_16_32_ord(#{enc}#{endian})") do
+ assert_equal(0xFEFF, bom.ord, bug9415)
+ end
+
define_method("test_utf_16_32_inspect(#{enc}#{endian}-BOM)") do
s = STR_WITH_BOM.encode(enc + endian)
# When a UTF-16/32 string has a BOM,