summaryrefslogtreecommitdiff
path: root/test/ruby/test_argf.rb
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-09 09:36:03 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-09 09:36:03 +0000
commit82de3b95c4c0bcd3f8ba0bac6f0dec81c787a067 (patch)
tree52818dc0c531dd7fd124441b12e0258919df330a /test/ruby/test_argf.rb
parentc7ce1554126fc0de1aaf12988ac8cf776cf57c9c (diff)
Fix error when Encoding.default_external is Encoding::IBM437
https://ci.appveyor.com/project/ruby/ruby/build/1.0.9151#L4601 ``` 1) Error: TestArgf#test_inplace_nonascii: Encoding::UndefinedConversionError: U+3042 from UTF-8 to IBM437 ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_argf.rb')
-rw-r--r--test/ruby/test_argf.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb
index 84397a2d01..a76bdccf45 100644
--- a/test/ruby/test_argf.rb
+++ b/test/ruby/test_argf.rb
@@ -258,12 +258,12 @@ class TestArgf < Test::Unit::TestCase
def test_inplace_nonascii
ext = Encoding.default_external or
skip "no default external encoding"
- if ext == Encoding::US_ASCII
- skip "external encoding is us-ascii"
- end
t = nil
- ["\u{3042}", "\u{e9}"].any? {|n| t = make_tempfile(n.encode(ext))} or
- skip "no name to test"
+ ["\u{3042}", "\u{e9}"].any? do |n|
+ t = make_tempfile(n.encode(ext))
+ rescue Encoding::UndefinedConversionError
+ end
+ t or skip "no name to test"
assert_in_out_err(["-i.bak", "-", t.path],
"#{<<~"{#"}\n#{<<~'};'}")
{#