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

Re: Ruby test failure

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: Thu, 19 Jun 2008 20:29:52 +0900 (JST)

Hi,

In <20080619082352.GD26547_at_p12n.org>
  "Ruby test failure [was Re: 1.5.0 up for signing/testing]" on Thu, 19 Jun 2008 03:23:52 -0500,
  Peter Samuelson <peter_at_p12n.org> wrote:

>
> I get an odd failure in the ruby test. It looks like a too-fragile
> test, but I have _no_ idea - maybe this is a real failure? Help.
> --
> Peter Samuelson | org-tld!p12n!peter | http://p12n.org/
>
>
> XXX/subversion/bindings/swig/ruby$ ruby1.8 test/run-test.rb test/test_wc.rb
> Loaded suite test_wc.rb
> Started
> ........F.........................
> Finished in 82.14625 seconds.
>
> 1) Failure:
> test_diff_callbacks_for_backward_compatibility(SvnWcTest)

{{{
Normalize compared value.

* subversion/bindings/swig/ruby/test/test_wc.rb
  (SvnWcTest#assert_diff_callbacks): Pass expected result to normalize.
  (SvnWcTest#test_diff_callbacks_for_backward_compatibility):
  Sort actual and expected result to compare.
  (SvnWcTest#test_diff_callbacks): Just receive and return expected result.
}}}

Thanks,

--
kou

Index: subversion/bindings/swig/ruby/test/test_wc.rb
===================================================================
--- subversion/bindings/swig/ruby/test/test_wc.rb (revision 31785)
+++ subversion/bindings/swig/ruby/test/test_wc.rb (working copy)
@@ -710,7 +710,7 @@
       reporter = session.diff(rev1, "", @repos_uri, editor)
       adm.crawl_revisions(dir_path, reporter)
 
- args = {
+ property_info = {
         :dir_changed_prop_names => [
                                     "svn:entry:committed-date",
                                     "svn:entry:uuid",
@@ -720,7 +720,8 @@
         :file_changed_prop_name => prop_name,
         :file_changed_prop_value => prop_value,
       }
- dir_changed_props, file_changed_props, empty_changed_props = yield(args)
+ expected_props, actual_result = yield(property_info, callbacks.result)
+ dir_changed_props, file_changed_props, empty_changed_props = expected_props
       assert_equal([
                     [:dir_props_changed, @wc_path, dir_changed_props],
                     [:file_changed, path1, file_changed_props],
@@ -731,29 +732,37 @@
   end
 
   def test_diff_callbacks_for_backward_compatibility
- assert_diff_callbacks(:diff_editor) do |args|
- dir_changed_props = args[:dir_changed_prop_names].collect do |name|
+ assert_diff_callbacks(:diff_editor) do |property_info, result|
+ dir_changed_prop_names = property_info[:dir_changed_prop_names]
+ dir_changed_props = dir_changed_prop_names.sort.collect do |name|
         Svn::Core::Prop.new(name, nil)
       end
- prop_name = args[:file_changed_prop_name]
- prop_value = args[:file_changed_prop_value]
+ prop_name = property_info[:file_changed_prop_name]
+ prop_value = property_info[:file_changed_prop_value]
       file_changed_props = [Svn::Core::Prop.new(prop_name, prop_value)]
       empty_changed_props = []
- [dir_changed_props, file_changed_props, empty_changed_props]
+
+ sorted_result = result.dup
+ dir_prop_changed = sorted_result.assoc(:dir_props_changed)
+ dir_prop_changed[2] = dir_prop_changed[2].sort_by {|prop| prop.name}
+
+ [[dir_changed_props, file_changed_props, empty_changed_props],
+ sorted_result]
     end
   end
 
   def test_diff_callbacks
- assert_diff_callbacks(:diff_editor2) do |args|
+ assert_diff_callbacks(:diff_editor2) do |property_info, result|
       dir_changed_props = {}
- args[:dir_changed_prop_names].each do |name|
+ property_info[:dir_changed_prop_names].each do |name|
         dir_changed_props[name] = nil
       end
- prop_name = args[:file_changed_prop_name]
- prop_value = args[:file_changed_prop_value]
+ prop_name = property_info[:file_changed_prop_name]
+ prop_value = property_info[:file_changed_prop_value]
       file_changed_props = {prop_name => prop_value}
       empty_changed_props = {}
- [dir_changed_props, file_changed_props, empty_changed_props]
+ [[dir_changed_props, file_changed_props, empty_changed_props],
+ result]
     end
   end
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-06-19 13:30:19 CEST

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.