From 641d6ece1ef85af7f1bfffdaa6defc4e5a8c9228 Mon Sep 17 00:00:00 2001 From: kazu Date: Mon, 14 Jul 2008 06:17:36 +0000 Subject: * 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 --- test/ruby/test_variable.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3