summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-11-19 15:41:38 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-11-19 15:41:53 +0900
commit44ad72fa2113d0e111a1cf76327bcc13de8393e1 (patch)
tree6ca6570a043c164bf421e1895c72f71a3a1c99a5
parent9c1e2a99fcf69c52fa1d8edcd5fe3961353233ab (diff)
Added assertions
-rw-r--r--test/ruby/test_iseq.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index 3ec06b4..78be07d 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -103,13 +103,13 @@ class TestISeq < Test::Unit::TestCase
f.puts "{ '\u00de' => 'Th', '\u00df' => 'ss', '\u00e0' => 'a' }"
f.close
- previous_external = Encoding.default_external
- Encoding.default_external = Encoding::US_ASCII
- begin
- load f.path
- RubyVM::InstructionSequence.compile_file(f.path)
- ensure
- Encoding.default_external = previous_external
+ EnvUtil.with_default_external(Encoding::US_ASCII) do
+ assert_warn('') {
+ load f.path
+ }
+ assert_nothing_raised(SyntaxError) {
+ RubyVM::InstructionSequence.compile_file(f.path)
+ }
end
end
end