2012-04-17 00:11:17 -04:00
|
|
|
require 'test/unit'
|
2014-04-05 19:52:52 -04:00
|
|
|
require 'tmpdir'
|
|
|
|
require 'rbconfig'
|
2012-04-17 00:11:17 -04:00
|
|
|
|
|
|
|
module Bug
|
|
|
|
module Win32
|
|
|
|
class TestDln < Test::Unit::TestCase
|
|
|
|
def test_check_imported
|
|
|
|
bug = '[Bug #6303]'
|
|
|
|
assert_in_out_err(['-r-test-/win32/dln', '-eexit'], '', [], [], bug, timeout: 10)
|
|
|
|
end
|
2014-04-05 19:52:52 -04:00
|
|
|
|
|
|
|
def test_nonascii_load
|
|
|
|
bug9699 = '[ruby-core:61845] [Bug #9699]'
|
2015-01-05 10:14:54 -05:00
|
|
|
so = "-test-/dln/empty." + RbConfig::CONFIG["DLEXT"]
|
2014-04-10 03:39:44 -04:00
|
|
|
so = $:.find {|d| d = ::File.join(d, so); break d if ::File.exist?(d)}
|
2014-04-05 19:52:52 -04:00
|
|
|
assert_not_nil(so)
|
2014-04-10 03:39:44 -04:00
|
|
|
Dir.mkdir(dir = ::File.join(testdir = Dir.mktmpdir("test"), "\u{30c6 30b9 30c8}"))
|
|
|
|
::File.copy_stream(so, ::File.join(dir, ::File.basename(so)))
|
|
|
|
assert_separately(['-', bug9699, testdir, ::File.basename(so)], <<-'end;')
|
2014-04-05 19:52:52 -04:00
|
|
|
bug, dir, so = *ARGV
|
|
|
|
assert_nothing_raised(LoadError, bug) do
|
2014-04-10 03:39:44 -04:00
|
|
|
require ::File.join(dir, "\u{30c6 30b9 30c8}", so)
|
2014-04-05 19:52:52 -04:00
|
|
|
end
|
|
|
|
end;
|
|
|
|
ensure
|
2014-04-10 03:39:44 -04:00
|
|
|
::File.unlink(::File.join(dir, ::File.basename(so))) rescue nil
|
2014-04-05 19:52:52 -04:00
|
|
|
Dir.rmdir(dir) rescue nil
|
|
|
|
Dir.rmdir(testdir) rescue nil
|
|
|
|
end
|
|
|
|
|
2012-04-17 00:11:17 -04:00
|
|
|
end
|
|
|
|
end
|
2012-04-17 07:14:24 -04:00
|
|
|
end if /mswin|mingw/ =~ RUBY_PLATFORM
|