[#11073] segfault printing instruction sequence for iterator — <noreply@...>

Bugs item #10527, was opened at 2007-05-02 14:42

14 messages 2007/05/02
[#11142] Re: [ ruby-Bugs-10527 ] segfault printing instruction sequence for iterator — Nobuyoshi Nakada <nobu@...> 2007/05/10

Hi,

[#11188] Re: [ ruby-Bugs-10527 ] segfault printing instruction sequence for iterator — Paul Brannan <pbrannan@...> 2007/05/16

On Thu, May 10, 2007 at 04:51:18PM +0900, Nobuyoshi Nakada wrote:

[#11234] Planning to release 1.8.6 errata — Urabe Shyouhei <shyouhei@...>

Hi all.

17 messages 2007/05/25

[ ruby-Patches-10379 ] Test::Unit::TestCase regression: register methods with arity == -1

From: <noreply@...>
Date: 2007-05-30 04:16:27 UTC
List: ruby-core #11356
Patches item #10379, was opened at 2007-04-26 01:34
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=10379&group_id=426

>Category: Developer Tools/Libs
Group: v1.9.x
Status: Open
Resolution: None
Priority: 3
Submitted By: Adam Bozanich (abozanich)
Assigned to: Nobody (None)
Summary: Test::Unit::TestCase regression: register methods with arity == -1

Initial Comment:
Test::Unit::TestCase is skipping over methods defined as below.  It looks like procs/blocks with no arguments have an arity of -1

irb(main):001:0> proc { }.arity
=> -1
irb(main):002:0> proc {|| }.arity
=> -1

The patch is a simple copy & paste from the 1.8 sources.

<example>

require 'test/unit'

class Foo
    attr_reader :attrs
    def initialize
        @attrs = Hash.new
        ("A".."Z").each {  |x|  @attrs[x] = x.downcase }
    end
end

tclass = Class.new( Test::Unit::TestCase )
Foo.const_set "TestAttr" , tclass

Foo.new.attrs.each_pair do |key,value|
    tclass.class_eval do
        define_method("test_#{key}") do
            assert_equal(key,value.upcase)
        end
    end
end

</example>


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=10379&group_id=426

In This Thread

Prev Next