diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-19 07:05:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-19 07:05:39 +0000 |
commit | c635662d7fb56dcf743c6bb32755904bc2914098 (patch) | |
tree | 8dc2ddcc0a0fd6f455e3ceb3349d14076ad7491a /test | |
parent | ae92a9e4ed7665130c816ae3f8a6927242d367ad (diff) | |
download | ruby-c635662d7fb56dcf743c6bb32755904bc2914098.tar.gz |
dir.c: warning for NUL
* dir.c (rb_push_glob): warn NUL-separated glob patterns.
[Feature #14643]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_dir.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index 7597262702..5323c764f5 100644 --- a/test/ruby/test_dir.rb +++ b/test/ruby/test_dir.rb @@ -136,8 +136,10 @@ 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_equal([@root] + ("a".."z").map {|f| File.join(@root, f) }.sort, - Dir.glob(@root + "\0\0\0" + 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) + end assert_equal(("a".."z").step(2).map {|f| File.join(File.join(@root, f), "") }.sort, Dir.glob(File.join(@root, "*/")).sort) |