[#19261] lstripped here-document (Re: comments and continuing strings on the next line) — nobu.nakada@...

なかだです。

29 messages 2003/01/01
[#19360] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "K.Kosako" <kosako@...> 2003/01/15

nobu.nakada@nifty.ne.jpさんの

[#19361] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "NAKAMURA, Hiroshi" <nakahiro@...> 2003/01/15

なひです。

[#19364] Re: lstripped here-document (Re: comments and continuing strings on the next line) — nobu.nakada@... 2003/01/17

なかだです。

[#19366] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "NAKAMURA, Hiroshi" <nakahiro@...> 2003/01/17

なひです。

[#19299] [BUG] errno == 0 — Kazuhiro Yoshida <moriq@...>

もりきゅうです。win32だけかもしれません。

22 messages 2003/01/04
[#19301] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19302] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19303] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19304] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19306] Re: [BUG] errno == 0 — nobu.nakada@... 2003/01/05

なかだです。

[ruby-dev:19447] shim/ruby16 patch

From: Kazuhiro NISHIYAMA <zn@...>
Date: 2003-01-31 18:06:09 UTC
List: ruby-dev #19447
西山和広です。

Regexp#eql?, Regexp#hashが気になっていたのでshimを
ちょっといじってみたパッチです。
test caseが足りないので適当になおして取り込んでください。

* test17をtest18に。
* make test16でFが出たのを修正。
* Regexp#eql?, Regexp#hash

Index: Makefile
===================================================================
RCS file: /src/shim/ruby16/Makefile,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile
--- Makefile	11 Sep 2002 06:42:13 -0000	1.12
+++ Makefile	31 Jan 2003 17:53:02 -0000
@@ -47,5 +47,5 @@ test: $(SETUP_COOKIE)
 test16:
 	$(MAKE) RUBY=ruby16 test
 
-test17:
-	$(MAKE) RUBY=ruby17 test
+test18:
+	$(MAKE) RUBY=ruby18 test
Index: lib/features/ruby18/proc.rb
===================================================================
RCS file: /src/shim/ruby16/lib/features/ruby18/proc.rb,v
retrieving revision 1.4
diff -u -p -r1.4 proc.rb
--- lib/features/ruby18/proc.rb	16 Apr 2002 00:22:54 -0000	1.4
+++ lib/features/ruby18/proc.rb	31 Jan 2003 17:53:02 -0000
@@ -4,11 +4,13 @@ require 'features/ruby18/base'
 
 class Proc
   def self.__ruby18_yield(args)
-    yield(*args)
+    yield(args)
   end
   def yield(*args)
-    if args.empty? or [nil] == args
+    if args.empty?
       call
+    elsif [nil] == args
+      call(nil)
     else
       type.__ruby18_yield(args, &self)
     end
Index: lib/features/ruby18/regexp.rb
===================================================================
RCS file: /src/shim/ruby16/lib/features/ruby18/regexp.rb,v
retrieving revision 1.4
diff -u -p -r1.4 regexp.rb
--- lib/features/ruby18/regexp.rb	11 Sep 2002 07:10:04 -0000	1.4
+++ lib/features/ruby18/regexp.rb	31 Jan 2003 17:53:02 -0000
@@ -3,6 +3,15 @@
 require 'features/ruby18/base'
 
 class Regexp
+  def eql?(o)
+    return false unless o.is_a?(Regexp)
+    source.eql?(o.source)
+  end
+
+  def hash
+    source.hash
+  end
+
   def options
     str = inspect
     pos = str.rindex(?/) + 1
Index: tests/features/ruby18/tc_proc.rb
===================================================================
RCS file: /src/shim/ruby16/tests/features/ruby18/tc_proc.rb,v
retrieving revision 1.4
diff -u -p -r1.4 tc_proc.rb
--- tests/features/ruby18/tc_proc.rb	16 Apr 2002 00:21:08 -0000	1.4
+++ tests/features/ruby18/tc_proc.rb	31 Jan 2003 17:53:02 -0000
@@ -84,8 +84,8 @@ class TC_Proc < Test::Unit::TestCase
   def test_yield_m
     f = proc {|*x| x}
     assert_equal([], f.yield())
-    assert_equal([], f.yield([]))
-    assert_equal([], f.yield(nil))
-    assert_equal([1], f.yield([1]))
+    assert_equal([[]], f.yield([]))
+    assert_equal([nil], f.yield(nil))
+    assert_equal([[1]], f.yield([1]))
   end
 end
Index: tests/features/ruby18/tc_regexp.rb
===================================================================
RCS file: /src/shim/ruby16/tests/features/ruby18/tc_regexp.rb,v
retrieving revision 1.4
diff -u -p -r1.4 tc_regexp.rb
--- tests/features/ruby18/tc_regexp.rb	11 Sep 2002 07:10:04 -0000	1.4
+++ tests/features/ruby18/tc_regexp.rb	31 Jan 2003 17:53:02 -0000
@@ -6,6 +6,14 @@ begin
 rescue LoadError; end
 
 class TC_Regexp < Test::Unit::TestCase
+  def test_eql?
+    assert(/a/.eql?(/a/))
+  end
+
+  def test_hash
+    assert_equal(/a/.hash, /a/.hash)
+  end
+
   def test_options
     re = /a/
 


-- 
|ZnZ(ゼット エヌ ゼット)
|西山和広(Kazuhiro NISHIYAMA)


In This Thread

Prev Next