mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
56036e3514
commit
92b7ae2bcc
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue