* test/etc/test_etc.rb (test_getpwuid): fix for users whose uid is

shared.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2008-07-29 04:21:32 +00:00
Родитель e7d2f303b7
Коммит f783b8d204
2 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Jul 29 13:17:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
* test/etc/test_etc.rb (test_getpwuid): fix for users whose uid is
shared.
Tue Jul 29 05:37:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Tue Jul 29 05:37:53 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_find_file_ext, rb_find_file): converts Windows style path * file.c (rb_find_file_ext, rb_find_file): converts Windows style path

Просмотреть файл

@ -28,9 +28,9 @@ class TestEtc < Test::Unit::TestCase
end end
def test_getpwuid def test_getpwuid
passwd = [] passwd = {}
Etc.passwd {|s| passwd << s } Etc.passwd {|s| passwd[s.uid] = s unless passwd[s.uid] }
passwd.each do |s| passwd.values.each do |s|
assert_equal(s, Etc.getpwuid(s.uid)) assert_equal(s, Etc.getpwuid(s.uid))
assert_equal(s, Etc.getpwuid) if Etc.getlogin == s.name assert_equal(s, Etc.getpwuid) if Etc.getlogin == s.name
end end