diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-29 14:25:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-29 14:25:23 +0000 |
commit | d2da9597c3b9f2dded80f53c16f4bf2c630e0ffe (patch) | |
tree | 0f4623c73532c50b878bd00b9c9711c75ac9b4a3 /test | |
parent | 8ffeda041b92f1dbdc05d9356e05d9f624922ef3 (diff) | |
download | ruby-d2da9597c3b9f2dded80f53c16f4bf2c630e0ffe.tar.gz |
* file.c (rb_get_path_check): clarify error message for
ASCII-incompatible path name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_path.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_path.rb b/test/ruby/test_path.rb index 31c1885371..74d568ae49 100644 --- a/test/ruby/test_path.rb +++ b/test/ruby/test_path.rb @@ -239,4 +239,12 @@ class TestPath < Test::Unit::TestCase assert_equal('', File.extname('.x')) assert_equal('', File.extname('..x')) end + + def test_ascii_incompatible_path + s = "\u{221e}\u{2603}" + assert_raise(Encoding::CompatibilityError) {open(s.encode("utf-16be"))} + assert_raise(Encoding::CompatibilityError) {open(s.encode("utf-16le"))} + assert_raise(Encoding::CompatibilityError) {open(s.encode("utf-32be"))} + assert_raise(Encoding::CompatibilityError) {open(s.encode("utf-32le"))} + end end |