diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-29 04:21:32 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-29 04:21:32 +0000 |
commit | f783b8d204e4124f1c7be9c92e6289aeb971b8a5 (patch) | |
tree | 7f32f97f6102e7054d277127a9da5cf5105dccf7 | |
parent | e7d2f303b737a33b99c9f93a093dad029bc1c24e (diff) | |
download | ruby-f783b8d204e4124f1c7be9c92e6289aeb971b8a5.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/etc/test_etc.rb | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -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> * file.c (rb_find_file_ext, rb_find_file): converts Windows style path diff --git a/test/etc/test_etc.rb b/test/etc/test_etc.rb index 48a17ff4bf..29e5f0bed2 100644 --- a/test/etc/test_etc.rb +++ b/test/etc/test_etc.rb @@ -28,9 +28,9 @@ class TestEtc < Test::Unit::TestCase end def test_getpwuid - passwd = [] - Etc.passwd {|s| passwd << s } - passwd.each do |s| + passwd = {} + Etc.passwd {|s| passwd[s.uid] = s unless passwd[s.uid] } + passwd.values.each do |s| assert_equal(s, Etc.getpwuid(s.uid)) assert_equal(s, Etc.getpwuid) if Etc.getlogin == s.name end |