diff options
author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-14 06:17:36 +0000 |
---|---|---|
committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-14 06:17:36 +0000 |
commit | 641d6ece1ef85af7f1bfffdaa6defc4e5a8c9228 (patch) | |
tree | aba7575d678a4d2be6d3cead18377290e17fdd94 | |
parent | 878a3f60b633aca65c5db954720fe230a7a67b33 (diff) | |
download | ruby-641d6ece1ef85af7f1bfffdaa6defc4e5a8c9228.tar.gz |
* test/ruby/test_variable.rb (TestVariable#test_global_variable_0): add test of $0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_variable.rb | 9 |
2 files changed, 14 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Mon Jul 14 15:16:40 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com> + + * test/ruby/test_variable.rb (TestVariable#test_global_variable_0): + add test of $0. + Mon Jul 14 13:36:15 2008 NAKAMURA Usaku <usa@ruby-lang.org> * ext/socket/extconf.rb: initialize winsock on win32 to avoid error diff --git a/test/ruby/test_variable.rb b/test/ruby/test_variable.rb index bfa5977f62..de9bc30d77 100644 --- a/test/ruby/test_variable.rb +++ b/test/ruby/test_variable.rb @@ -1,4 +1,5 @@ require 'test/unit' +require_relative 'envutil' class TestVariable < Test::Unit::TestCase class Gods @@ -75,4 +76,12 @@ class TestVariable < Test::Unit::TestCase end end.call end + + def test_global_variable_0 + EnvUtil.rubyexec("-e", "$0='t'*1000;print $0") do |w, r, e| + w.close + assert_equal("", e.read) + assert_match(/\At+\z/, r.read) + end + end end |