summaryrefslogtreecommitdiff
path: root/test/-ext-
diff options
context:
space:
mode:
Diffstat (limited to 'test/-ext-')
-rw-r--r--test/-ext-/win32/test_dln.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/-ext-/win32/test_dln.rb b/test/-ext-/win32/test_dln.rb
index 7c5fe61f59..40c1f533b0 100644
--- a/test/-ext-/win32/test_dln.rb
+++ b/test/-ext-/win32/test_dln.rb
@@ -1,4 +1,6 @@
require 'test/unit'
+require 'tmpdir'
+require 'rbconfig'
require_relative '../../ruby/envutil'
module Bug
@@ -8,6 +10,26 @@ module Bug
bug = '[Bug #6303]'
assert_in_out_err(['-r-test-/win32/dln', '-eexit'], '', [], [], bug, timeout: 10)
end
+
+ def test_nonascii_load
+ bug9699 = '[ruby-core:61845] [Bug #9699]'
+ so = "-test-/win32/dln/empty." + RbConfig::CONFIG["DLEXT"]
+ so = $:.find {|d| d = File.join(d, so); break d if File.exist?(d)}
+ assert_not_nil(so)
+ 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;')
+ bug, dir, so = *ARGV
+ assert_nothing_raised(LoadError, bug) do
+ require File.join(dir, "\u{30c6 30b9 30c8}", so)
+ end
+ end;
+ ensure
+ File.unlink(File.join(dir, File.basename(so))) rescue nil
+ Dir.rmdir(dir) rescue nil
+ Dir.rmdir(testdir) rescue nil
+ end
+
end
end
end if /mswin|mingw/ =~ RUBY_PLATFORM