[前][次][番号順一覧][スレッド一覧]

ruby-changes:6739

From: naruse <ko1@a...>
Date: Tue, 29 Jul 2008 13:21:48 +0900 (JST)
Subject: [ruby-changes:6739] Ruby:r18255 (trunk): * test/etc/test_etc.rb (test_getpwuid): fix for users whose uid is

naruse	2008-07-29 13:21:32 +0900 (Tue, 29 Jul 2008)

  New Revision: 18255

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18255

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

  Modified files:
    trunk/ChangeLog
    trunk/test/etc/test_etc.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 18254)
+++ ChangeLog	(revision 18255)
@@ -1,3 +1,8 @@
+Tue Jul 29 13:17:03 2008  NARUSE, Yui  <naruse@r...>
+
+	* test/etc/test_etc.rb (test_getpwuid): fix for users whose uid is
+	  shared. 
+
 Tue Jul 29 05:37:53 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* file.c (rb_find_file_ext, rb_find_file): converts Windows style path
Index: test/etc/test_etc.rb
===================================================================
--- test/etc/test_etc.rb	(revision 18254)
+++ test/etc/test_etc.rb	(revision 18255)
@@ -28,9 +28,9 @@
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]