ruby-changes:19741
From: naruse <ko1@a...>
Date: Mon, 30 May 2011 01:49:23 +0900 (JST)
Subject: [ruby-changes:19741] naruse:r31786 (trunk): try and catch for the test of setenv(3).
naruse 2011-05-30 01:49:14 +0900 (Mon, 30 May 2011) New Revision: 31786 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31786 Log: try and catch for the test of setenv(3). Modified files: trunk/test/ruby/test_env.rb Index: test/ruby/test_env.rb =================================================================== --- test/ruby/test_env.rb (revision 31785) +++ test/ruby/test_env.rb (revision 31786) @@ -124,13 +124,17 @@ assert_equal(nil, ENV["test"]) assert_raise(ArgumentError) { ENV["foo\0bar"] = "test" } assert_raise(ArgumentError) { ENV["test"] = "foo\0bar" } - if /netbsd|openbsd/ =~ RUBY_PLATFORM + + begin + # setenv(3) allowed the name includes '=', + # but POSIX.1-2001 says it should fail with EINVAL. + # see also http://togetter.com/li/22380 ENV["foo=bar"] = "test" assert_equal("test", ENV["foo=bar"]) assert_equal("test", ENV["foo"]) - else - assert_raise(Errno::EINVAL) { ENV["foo=bar"] = "test" } + rescue Errno::EINVAL end + ENV[PATH_ENV] = "/tmp/".taint assert_equal("/tmp/", ENV[PATH_ENV]) end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/