summaryrefslogtreecommitdiff
path: root/test/ruby/test_system.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-29 09:56:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-29 09:56:03 +0000
commitee5add4a793fb5d0fda51dbc01c59842e5f615c2 (patch)
tree0cea0c54ba93f85dc955b4c53a7f96eb58627aec /test/ruby/test_system.rb
parentae72efc541bc716b86124a1807cfea1257938ad4 (diff)
* dln.c (dln_find_1): fix for files with dots. [ruby-dev:38588]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_system.rb')
-rw-r--r--test/ruby/test_system.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index be441c95fe..903918812d 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -60,6 +60,28 @@ class TestSystem < Test::Unit::TestCase
File.unlink tmpfilename or `/bin/rm -f "#{tmpfilename}"`
File.unlink "#{tmpfilename}.bak" or `/bin/rm -f "#{tmpfilename}.bak"`
+
+ if /mswin|mingw/ =~ RUBY_PLATFORM
+ testname = '[ruby-dev:38588]'
+ batch = "batch_tmp.#{$$}"
+ tmpfilename = "#{tmpdir}/#{batch}.bat"
+ open(tmpfilename, "wb") {|f| f.print "\r\n"}
+ assert(system(tmpfilename), testname)
+ assert(system("#{tmpdir}/#{batch}"), testname)
+ assert(system(tmpfilename, "1"), testname)
+ assert(system("#{tmpdir}/#{batch}", "1"), testname)
+ begin
+ path = ENV["PATH"]
+ ENV["PATH"] = "#{tmpdir.tr(File::SEPARATOR, File::ALT_SEPARATOR)}#{File::PATH_SEPARATOR + path if path}"
+ assert(system("#{batch}.bat"), testname)
+ assert(system(batch), testname)
+ assert(system("#{batch}.bat", "1"), testname)
+ assert(system(batch, "1"), testname)
+ ensure
+ ENV["PATH"] = path
+ end
+ File.unlink tmpfilename
+ end
}
end