mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/etc/test_etc.rb: avoid infinite loop. [ruby-dev:35158]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
87d053f000
commit
33e5cfee7b
3 changed files with 14 additions and 6 deletions
|
|
@ -28,14 +28,18 @@ class TestEtc < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_getpwuid
|
||||
Etc.passwd do |s|
|
||||
passwd = []
|
||||
Etc.passwd {|s| passwd << s }
|
||||
passwd.each do |s|
|
||||
assert_equal(s, Etc.getpwuid(s.uid))
|
||||
assert_equal(s, Etc.getpwuid) if Etc.getlogin == s.name
|
||||
end
|
||||
end
|
||||
|
||||
def test_getpwnam
|
||||
Etc.passwd do |s|
|
||||
passwd = []
|
||||
Etc.passwd {|s| passwd << s }
|
||||
passwd.each do |s|
|
||||
assert_equal(s, Etc.getpwnam(s.name))
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue