summaryrefslogtreecommitdiffstats
path: root/test/fileutils
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-07 12:04:19 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-07 12:04:19 +0000
commit15193e110bded2f218c993f60c258fbb9c0233c7 (patch)
tree01079890f150f479d0b22d4ff9441afc234ae361 /test/fileutils
parent9a06a65fc857a78ac6d9df722e1e5af955bd2d3a (diff)
downloadruby-15193e110bded2f218c993f60c258fbb9c0233c7.tar.gz
ruby-15193e110bded2f218c993f60c258fbb9c0233c7.tar.xz
ruby-15193e110bded2f218c993f60c258fbb9c0233c7.zip
* lib/fileutils.rb (fu_list): Array() breaks pathes including "\n". [ruby-core:02843]
* test/fileutils/test_fileutils.rb (mkdir): test "\n" in path. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fileutils')
-rw-r--r--test/fileutils/test_fileutils.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 6d8810b8f..950e20499 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -51,6 +51,18 @@ def have_hardlink?
HAVE_HARDLINK
end
+begin
+ Dir.mkdir("\n")
+ Dir.rmdir("\n")
+ def lf_in_path_allowed?
+ true
+ end
+rescue
+ def lf_in_path_allowed?
+ false
+ end
+end
+
Dir.chdir prevdir
Dir.rmdir tmproot
@@ -532,6 +544,12 @@ end
assert_equal 0700, (File.stat('tmp/tmp').mode & 0777) if have_file_perm?
Dir.rmdir 'tmp/tmp'
+if lf_in_path_allowed?
+ mkdir "tmp-first-line\ntmp-second-line"
+ assert_directory "tmp-first-line\ntmp-second-line"
+ Dir.rmdir "tmp-first-line\ntmp-second-line"
+end
+
# pathname
assert_nothing_raised {
mkdir Pathname.new('tmp/tmpdirtmp')