summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-29 04:21:32 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-29 04:21:32 +0000
commit0579c42c93323a34edc28e433d7534c8a6c6285f (patch)
tree7f32f97f6102e7054d277127a9da5cf5105dccf7 /test
parent0a75637fa85da53d2050ec974243c1860ee6bcf2 (diff)
downloadruby-0579c42c93323a34edc28e433d7534c8a6c6285f.tar.gz
ruby-0579c42c93323a34edc28e433d7534c8a6c6285f.tar.xz
ruby-0579c42c93323a34edc28e433d7534c8a6c6285f.zip
* test/etc/test_etc.rb (test_getpwuid): fix for users whose uid is
shared. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/etc/test_etc.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/etc/test_etc.rb b/test/etc/test_etc.rb
index 48a17ff4b..29e5f0bed 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