summaryrefslogtreecommitdiff
path: root/test/ruby/test_dir_m17n.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_dir_m17n.rb')
-rw-r--r--test/ruby/test_dir_m17n.rb29
1 files changed, 15 insertions, 14 deletions
diff --git a/test/ruby/test_dir_m17n.rb b/test/ruby/test_dir_m17n.rb
index 81accb7..6701e0b 100644
--- a/test/ruby/test_dir_m17n.rb
+++ b/test/ruby/test_dir_m17n.rb
@@ -26,7 +26,6 @@ class TestDir_M17N < Test::Unit::TestCase
end
def test_filename_extutf8_invalid
- skip "ruby on windows doesn't support invalid utf-8 path" if /mswin|mingw/ =~ RUBY_PLATFORM
with_tmpdir {|d|
assert_ruby_status(%w[-EASCII-8BIT], <<-'EOS', nil, :chdir=>d)
filename = "\xff".force_encoding("ASCII-8BIT") # invalid byte sequence as UTF-8
@@ -43,7 +42,7 @@ class TestDir_M17N < Test::Unit::TestCase
exit ents.include?(filename) || ((RUBY_PLATFORM =~ /darwin/) != nil && ents.include?("%FF"))
EOS
}
- end
+ end unless /mswin|mingw/ =~ RUBY_PLATFORM
def test_filename_as_bytes_extutf8
with_tmpdir {|d|
@@ -67,18 +66,20 @@ class TestDir_M17N < Test::Unit::TestCase
exit false
end
EOS
- skip "no meaning test on windows" if /mswin|mingw/ =~ RUBY_PLATFORM
- assert_ruby_status(%w[-EUTF-8], <<-'EOS', nil, :chdir=>d)
- filename1 = "\xc2\xa1".force_encoding("utf-8")
- filename2 = "\xc2\xa1".force_encoding("euc-jp")
- filename3 = filename1.encode("euc-jp")
- filename4 = filename2.encode("utf-8")
- s1 = File.stat(filename1) rescue nil
- s2 = File.stat(filename2) rescue nil
- s3 = File.stat(filename3) rescue nil
- s4 = File.stat(filename4) rescue nil
- exit((s1 && s2 && !s3 && !s4) ? true : false)
- EOS
+ # no meaning test on windows
+ unless /mswin|mingw/ =~ RUBY_PLATFORM
+ assert_ruby_status(%w[-EUTF-8], <<-'EOS', nil, :chdir=>d)
+ filename1 = "\xc2\xa1".force_encoding("utf-8")
+ filename2 = "\xc2\xa1".force_encoding("euc-jp")
+ filename3 = filename1.encode("euc-jp")
+ filename4 = filename2.encode("utf-8")
+ s1 = File.stat(filename1) rescue nil
+ s2 = File.stat(filename2) rescue nil
+ s3 = File.stat(filename3) rescue nil
+ s4 = File.stat(filename4) rescue nil
+ exit((s1 && s2 && !s3 && !s4) ? true : false)
+ EOS
+ end
}
end