[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Need Ruby expertise to fix SvnClientTest::test_cleanup

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: 2006-07-06 15:39:45 CEST

Hi,

In <20060704161702.GJ3362@lorenz.farside.org.uk>
  "Re: Need Ruby expertise to fix SvnClientTest::test_cleanup" on Tue, 4 Jul 2006 17:17:02 +0100,
  Malcolm Rowe <malcolm-svn-dev@farside.org.uk> wrote:

> > When a svn_error_t whose constant happens to be the first in its
> > category (i.e., its apr_err equals one of the CATEGORY_START constants),
> > Ruby thinks it has a FOO_CATEGORY_START error, not whatever the real
> > error is.
> >
> > This is causing SvnClientTest::test_cleanup to fail.
> >
> > Someone needs to fix the "Ext::Core.constants.each do |const_name|" loop
> > in svn/error.rb to ignore constants ending with _CATEGORY_START. Since I
> > do not know any Ruby, that someone cannot be me.
> >
>
> I don't know any Ruby either, but this seems simple enough.
> Does this work?

You can run test case by "make check-swig-rb".

> Index: subversion/bindings/swig/ruby/svn/error.rb
> ===================================================================
> --- subversion/bindings/swig/ruby/svn/error.rb (revision 20417)
> +++ subversion/bindings/swig/ruby/svn/error.rb (working copy)
> @@ -7,6 +7,7 @@
>
> Ext::Core.constants.each do |const_name|
> if /^SVN_ERR_(.*)/ =~ const_name
> + next if /^SVN_ERR_.*_CATEGORY_START$/ =~ #{$1}
> value = Ext::Core.const_get(const_name)
> module_eval(<<-EOC, __FILE__, __LINE__)
> class #{$1} < Error
>
>
> Or does the second regex destroy the value of $1 obtained from the
> grouping in the first regex?

Yes.
This patch causes another bug.

Thanks,

--
kou
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jul 6 15:40:26 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.