From 4c79752cdfd315b2cb0e933bb4196ca04696b89a Mon Sep 17 00:00:00 2001 From: kosaki Date: Sat, 14 May 2011 10:53:29 +0000 Subject: [PATCH] * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name): add for $0 test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ test/ruby/test_rubyoptions.rb | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 865ff13120..57b30b8a6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat May 14 19:52:22 2011 KOSAKI Motohiro + + * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name): + add for $0 test. + Sat May 14 19:50:46 2011 KOSAKI Motohiro * missing/setproctitle.c (compat_init_setproctitle): use diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index c483d1f216..d0522da06c 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -400,6 +400,14 @@ class TestRubyOptions < Test::Unit::TestCase } end + def test_set_program_name + skip if /linux|freebsd|netbsd|openbsd/ !~ RUBY_PLATFORM + + $0 = 'hello world' + ps = `ps -p #{$$} -o cmd` + assert_match(/hello world/, ps) + end + def test_segv_test opts = {} if /mswin|mingw/ =~ RUBY_PLATFORM