mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 02:23:59 +02:00
Make sure that ENV.[]= fails when an invalid variable name is given.
Fix this if there is an environment where a variable name containing an '=' is allowed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f60a5d6f46
commit
8c801be9bf
1 changed files with 1 additions and 0 deletions
|
@ -122,6 +122,7 @@ 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" }
|
||||
ENV[PATH_ENV] = "/tmp/".taint
|
||||
assert_equal("/tmp/", ENV[PATH_ENV])
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue