summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-29 13:51:52 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-29 13:51:52 +0000
commitddc32f1acc273a7c8bd8fdc78e1c92b9def0fc77 (patch)
treeab333c42831254defc0d7ce5505dcf2d6d761dd4
parent14f54b97c75d4ac9355fef82b7e749a7aa632e47 (diff)
downloadruby-ddc32f1acc273a7c8bd8fdc78e1c92b9def0fc77.tar.gz
ruby-ddc32f1acc273a7c8bd8fdc78e1c92b9def0fc77.tar.xz
ruby-ddc32f1acc273a7c8bd8fdc78e1c92b9def0fc77.zip
* test/ruby/test_require.rb: add a test for load with wrap flag, to
achieve 100% test coverage of eval_jump.c. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_require.rb20
2 files changed, 25 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index bb291d4a2..2dc39c5f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu May 29 22:51:05 2008 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * test/ruby/test_require.rb: add a test for load with wrap flag, to
+ achieve 100% test coverage of eval_jump.c.
+
Thu May 29 22:47:53 2008 Yusuke Endoh <mame@tsg.ne.jp>
* test/ruby/test_argf.rb: new tests for ARGF, to achieve over 85% test
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 299baeac6..b7fb90d92 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -212,4 +212,24 @@ class TestRequire < Test::Unit::TestCase
assert_equal(":ok", r.read.chomp)
end
end
+
+ def test_load
+ t = Tempfile.new(["test_ruby_test_require", ".rb"])
+ t.puts "module Foo; end"
+ t.puts "at_exit { p :wrap_end }"
+ t.puts "at_exit { raise 'error in at_exit test' }"
+ t.puts "p :ok"
+ t.close
+
+ ruby do |w, r, e|
+ w.puts "load(#{ t.path.dump }, true)"
+ w.puts "GC.start"
+ w.puts "p :end"
+ w.close
+ assert_match(/error in at_exit test/, e.read)
+ assert_equal(":ok\n:end\n:wrap_end", r.read.chomp)
+ end
+
+ assert_raise(ArgumentError) { at_exit }
+ end
end