ruby-changes:5191
From: mame <ko1@a...>
Date: Thu, 29 May 2008 22:52:08 +0900 (JST)
Subject: [ruby-changes:5191] Ruby:r16686 (trunk): * test/ruby/test_require.rb: add a test for load with wrap flag, to
mame 2008-05-29 22:51:52 +0900 (Thu, 29 May 2008)
New Revision: 16686
Modified files:
trunk/ChangeLog
trunk/test/ruby/test_require.rb
Log:
* test/ruby/test_require.rb: add a test for load with wrap flag, to
achieve 100% test coverage of eval_jump.c.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16686&r2=16685&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_require.rb?r1=16686&r2=16685&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 16685)
+++ ChangeLog (revision 16686)
@@ -1,3 +1,8 @@
+Thu May 29 22:51:05 2008 Yusuke Endoh <mame@t...>
+
+ * 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@t...>
* test/ruby/test_argf.rb: new tests for ARGF, to achieve over 85% test
Index: test/ruby/test_require.rb
===================================================================
--- test/ruby/test_require.rb (revision 16685)
+++ test/ruby/test_require.rb (revision 16686)
@@ -212,4 +212,24 @@
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
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/