summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-14 06:17:36 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-14 06:17:36 +0000
commita83153d89dc7a678984dba1d2cd73d954fc6e8d4 (patch)
treeaba7575d678a4d2be6d3cead18377290e17fdd94 /test
parent22c0ee6ee22d06ec77e6e0928f1c7ee2bc6f484a (diff)
downloadruby-a83153d89dc7a678984dba1d2cd73d954fc6e8d4.tar.gz
ruby-a83153d89dc7a678984dba1d2cd73d954fc6e8d4.tar.xz
ruby-a83153d89dc7a678984dba1d2cd73d954fc6e8d4.zip
* test/ruby/test_variable.rb (TestVariable#test_global_variable_0): add test of $0.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_variable.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_variable.rb b/test/ruby/test_variable.rb
index bfa5977f6..de9bc30d7 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