mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
878a3f60b6
commit
641d6ece1e
2 changed files with 14 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue