diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-20 18:11:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-20 18:11:23 +0000 |
commit | 1891b60f268780fe4e9d970ffa759c3d7dd0e00b (patch) | |
tree | 804b86101f61f90c4cea29841352f14ca583018e /test/ruby/test_dir_m17n.rb | |
parent | a7092270da3528a09ca4e2249e55ab12cb7f4c11 (diff) | |
download | ruby-1891b60f268780fe4e9d970ffa759c3d7dd0e00b.tar.gz |
dir.c: compose HFS file names
* dir.c (dir_each): compose HFS file names from
UTF8-MAC. [ruby-core:48745] [Bug #7267]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_dir_m17n.rb')
-rw-r--r-- | test/ruby/test_dir_m17n.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb index 79017c03a2..2f8b1baef3 100644 --- a/test/ruby/test_dir_m17n.rb +++ b/test/ruby/test_dir_m17n.rb @@ -305,4 +305,24 @@ class TestDir_M17N < Test::Unit::TestCase end } end + + def test_entries_compose + bug7267 = '[ruby-core:48745] [Bug #7267]' + + pp = Object.new.extend(Test::Unit::Assertions) + def pp.mu_pp(ary) #:nodoc: + '[' << ary.map {|str| "#{str.dump}(#{str.encoding})"}.join(', ') << ']' + end + + with_tmpdir {|d| + orig = %W"d\u{e9}tente x\u{304c 304e 3050 3052 3054}" + orig.each {|n| open(n, "w") {}} + if /mswin|mingw/ =~ RUBY_PLATFORM + opts = {:encoding => Encoding.default_external} + orig.map! {|o| o.encode(Encoding.find("filesystem")) rescue o.tr("^a-z", "?")} + end + ents = Dir.entries(".", opts).reject {|n| /\A\./ =~ n} + pp.assert_equal(orig, ents, bug7267) + } + end end |