summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-16 02:27:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-16 02:27:07 +0000
commita583f4206210cfccd9228d6f1f0cef0f2fdb5b92 (patch)
tree3dce7af46eda64a3cbba90a43f76a4f26d21c5a8 /test
parent7b4f0c0d1d4815807b000506cb470eb925834f9d (diff)
file.c: ASCII-compatible
* file.c (rb_file_join): check nul-byte only for strings, since FilePathStringValue() does it. [ruby-core:48012] [Bug #7168] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file_exhaustive.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index f697488192..10d04ddf15 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -793,6 +793,18 @@ class TestFileExhaustive < Test::Unit::TestCase
bug7168 = '[ruby-core:48012]'
names = %w"a b".map {|s| s.encode(Encoding::UTF_16LE)}
assert_raise(Encoding::CompatibilityError, bug7168) {File.join(*names)}
+ assert_raise(Encoding::CompatibilityError, bug7168) {File.join(names)}
+
+ a = Object.new
+ b = names[1]
+ names = [a, "b"]
+ a.singleton_class.class_eval do
+ define_method(:to_path) do
+ names[1] = b
+ "a"
+ end
+ end
+ assert_raise(Encoding::CompatibilityError, bug7168) {File.join(names)}
end
def test_truncate