mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_dir_m17n.rb: test_glob_incompatible
* test/ruby/test_dir_m17n.rb (TestDir_M17N#test_glob_incompatible): move from test_dir.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f65e683ccc
commit
f1df537a83
2 changed files with 7 additions and 5 deletions
|
@ -164,11 +164,6 @@ class TestDir < Test::Unit::TestCase
|
|||
|
||||
assert_equal([File.join(@root, "a")], Dir.glob(File.join(@root, 'a\\')))
|
||||
assert_equal((?a..?f).map {|f| File.join(@root, f) }.sort, Dir.glob(File.join(@root, '[abc/def]')).sort)
|
||||
|
||||
d = "\u{3042}\u{3044}".encode("utf-16le")
|
||||
assert_raise(Encoding::CompatibilityError) {Dir.glob(d)}
|
||||
m = Class.new {define_method(:to_path) {d}}
|
||||
assert_raise(Encoding::CompatibilityError) {Dir.glob(m.new)}
|
||||
end
|
||||
|
||||
def test_foreach
|
||||
|
|
|
@ -262,4 +262,11 @@ class TestDir_M17N < Test::Unit::TestCase
|
|||
}
|
||||
assert_equal(paths.map(&:encoding), encs, bug6072)
|
||||
end
|
||||
|
||||
def test_glob_incompatible
|
||||
d = "\u{3042}\u{3044}".encode("utf-16le")
|
||||
assert_raise(Encoding::CompatibilityError) {Dir.glob(d)}
|
||||
m = Class.new {define_method(:to_path) {d}}
|
||||
assert_raise(Encoding::CompatibilityError) {Dir.glob(m.new)}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue