diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-02 15:08:53 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-02 15:08:53 +0900 |
commit | 6f206b8ec6f945804c56cf8249739c6e94ed65f6 (patch) | |
tree | 8e04d964baa3cd07239dcaeb35ed41d113c55c39 /test/ruby/test_dir.rb | |
parent | 633ae3278ecce7c2b98fa1aa6106f963894c538a (diff) | |
download | ruby-6f206b8ec6f945804c56cf8249739c6e94ed65f6.tar.gz |
Prohibit nul-separated glob pattern [Feature #14643] (#2419)
Diffstat (limited to 'test/ruby/test_dir.rb')
-rw-r--r-- | test/ruby/test_dir.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index 93ae3c3ed9..75cae71093 100644 --- a/test/ruby/test_dir.rb +++ b/test/ruby/test_dir.rb @@ -138,9 +138,8 @@ class TestDir < Test::Unit::TestCase Dir.glob(File.join(@root, "*"), File::FNM_DOTMATCH).sort) assert_equal([@root] + ("a".."z").map {|f| File.join(@root, f) }.sort, Dir.glob([@root, File.join(@root, "*")]).sort) - assert_warning(/nul-separated patterns/) do - assert_equal([@root] + ("a".."z").map {|f| File.join(@root, f) }.sort, - Dir.glob(@root + "\0\0\0" + File.join(@root, "*")).sort) + assert_raise_with_message(ArgumentError, /nul-separated/) do + Dir.glob(@root + "\0\0\0" + File.join(@root, "*")) end assert_equal(("a".."z").step(2).map {|f| File.join(File.join(@root, f), "") }.sort, |