1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_env.rb (test_key): should test ENV.key instead of

ENV.index. [ruby-dev:25994]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2005-04-06 07:19:54 +00:00
parent 5f3a36794a
commit 17167ece8a
2 changed files with 14 additions and 9 deletions

View file

@ -1,3 +1,8 @@
Wed Apr 6 16:06:30 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* test/ruby/test_env.rb (test_key): should test ENV.key instead of
ENV.index. [ruby-dev:25994]
Tue Apr 5 16:01:12 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/*: refactored.

View file

@ -59,26 +59,26 @@ class TestEnv < Test::Unit::TestCase
assert_equal(true, ENV.has_value?(val.upcase))
end
def test_index
def test_key
val = 'a'
val.succ! while ENV.has_value?(val) && ENV.has_value?(val.upcase)
ENV['test'] = val[0...-1]
assert_nil(ENV.index(val))
assert_nil(ENV.index(val.upcase))
assert_nil(ENV.key(val))
assert_nil(ENV.key(val.upcase))
ENV['test'] = val
if IGNORE_CASE
assert_equal('TEST', ENV.index(val).upcase)
assert_equal('TEST', ENV.key(val).upcase)
else
assert_equal('test', ENV.index(val))
assert_equal('test', ENV.key(val))
end
assert_nil(ENV.index(val.upcase))
assert_nil(ENV.key(val.upcase))
ENV['test'] = val.upcase
assert_nil(ENV.index(val))
assert_nil(ENV.key(val))
if IGNORE_CASE
assert_equal('TEST', ENV.index(val.upcase).upcase)
assert_equal('TEST', ENV.key(val.upcase).upcase)
else
assert_equal('test', ENV.index(val.upcase))
assert_equal('test', ENV.key(val.upcase))
end
end
end