aboutsummaryrefslogtreecommitdiffstats
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
commitf783b8d204e4124f1c7be9c92e6289aeb971b8a5 (patch)
tree7f32f97f6102e7054d277127a9da5cf5105dccf7
parente7d2f303b737a33b99c9f93a093dad029bc1c24e (diff)
downloadruby-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--ChangeLog5
-rw-r--r--test/etc/test_etc.rb6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1081a83bf6..795f81c7d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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