From 92b7ae2bcc9db315eb5262da1e7245e6f317e5ab Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 19 May 2010 11:50:33 +0000 Subject: [PATCH] Fix test to follow NetBSD's setenv(3). On NetBSD, setenv("FOO=bar", "buzz") is interpreted that environ is "FOO=buzz". This is from API change in POSIX.1-2001. http://togetter.com/li/22380 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_env.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb index 17c7666e07..caa85d396d 100644 --- a/test/ruby/test_env.rb +++ b/test/ruby/test_env.rb @@ -123,7 +123,13 @@ class TestEnv < Test::Unit::TestCase assert_equal(nil, ENV["test"]) assert_raise(ArgumentError) { ENV["foo\0bar"] = "test" } assert_raise(ArgumentError) { ENV["test"] = "foo\0bar" } - assert_raise(Errno::EINVAL) { ENV["foo=bar"] = "test" } + if /netbsd/ =~ RUBY_PLATFORM + ENV["foo=bar"] = "test" + assert_equal("test", ENV["foo=bar"]) + assert_equal("test", ENV["foo"]) + else + assert_raise(Errno::EINVAL) { ENV["foo=bar"] = "test" } + end ENV[PATH_ENV] = "/tmp/".taint assert_equal("/tmp/", ENV[PATH_ENV]) end