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

Re: Status report for Ruby bindings on Windows

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: 2007-02-01 13:06:06 CET

Hi,

In <ae6cb1100701312124n3f47adcfr9f35b98ff14d190e@mail.gmail.com>
  "Re: Status report for Ruby bindings on Windows" on Wed, 31 Jan 2007 21:24:30 -0800,
  "Joe Swatosh" <joe.swatosh@gmail.com> wrote:

> > > * Normalizing the line breaks. Upon reflection, I've decided that I
> > > started us down the wrong path when I modified the tests for the line
> > > ending issues. As I've thought about it more, I now believe that the
> > > bindings should do the conversions. My thinking is since Ruby treats
> > > line endings as "'\n" instead of "\r\n" the bindings should provide
> > > any multiline values Ruby expects. (This is where the 'b' comes from
> > > when calling File::open. Without the 'b' on windows there is a \r\n
> > > to \n conversion. With the 'b', no conversion. Maybe we should check
> > > out what the Perl and Python bindings do about this issue on
> > > windows?). (I've made zero effort to figure out what this will take).
> >
> > OK. We'll try the problem after we solve test environment
> > problem on Windows.
> >
>
> Removing all invocations and the definition of normalize_line_break
> from the test\*.rb files and the attached patch get us:

It seems that the changes make cat ignore svn:eof-style. I
think tests have a problem. Could you try the attached
patch?

Thanks

--
kou

Index: subversion/bindings/swig/ruby/test/test_client.rb
===================================================================
--- subversion/bindings/swig/ruby/test/test_client.rb (revision 23317)
+++ subversion/bindings/swig/ruby/test/test_client.rb (working copy)
@@ -820,7 +820,8 @@
   def test_merge
     log = "sample log"
     file = "sample.txt"
- src = normalize_line_break("sample\n")
+ src = "sample\n"
+ normalized_src = normalize_line_break(src)
     trunk = File.join(@wc_path, "trunk")
     branch = File.join(@wc_path, "branch")
     trunk_path = File.join(trunk, file)
@@ -840,7 +841,7 @@
     ctx.merge(branch, rev1, branch, rev2, trunk)
     rev3 = ctx.commit(@wc_path).revision
 
- assert_equal(src, ctx.cat(trunk_path, rev3))
+ assert_equal(normalized_src, ctx.cat(trunk_path, rev3))
     
     ctx.rm(branch_path)
     rev4 = ctx.commit(@wc_path).revision
@@ -867,7 +868,8 @@
   def test_merge_peg
     log = "sample log"
     file = "sample.txt"
- src = normalize_line_break("sample\n")
+ src = "sample\n"
+ normalized_src = normalize_line_break"sample\n"
     trunk = File.join(@wc_path, "trunk")
     branch = File.join(@wc_path, "branch")
     trunk_path = File.join(trunk, file)
@@ -887,7 +889,7 @@
     ctx.merge_peg(branch, rev1, rev2, trunk)
     rev3 = ctx.commit(@wc_path).revision
 
- assert_equal(src, ctx.cat(trunk_path, rev3))
+ assert_equal(normalized_src, ctx.cat(trunk_path, rev3))
     
     ctx.rm(branch_path)
     rev4 = ctx.commit(@wc_path).revision
@@ -1273,8 +1275,10 @@
   
   def test_cat
     log = "sample log"
- src1 = normalize_line_break("source1\n")
- src2 = normalize_line_break("source2\n")
+ src1 = "source1\n"
+ src2 = "source2\n"
+ normalized_src1 = normalize_line_break(src1)
+ normalized_src2 = normalize_line_break(src2)
     file = "sample.txt"
     path = File.join(@wc_path, file)
 
@@ -1285,17 +1289,17 @@
     commit_info = ctx.commit(@wc_path)
     rev1 = commit_info.revision
 
- assert_equal(src1, ctx.cat(path, rev1))
- assert_equal(src1, ctx.cat(path))
+ assert_equal(normalized_src1, ctx.cat(path, rev1))
+ assert_equal(normalized_src1, ctx.cat(path))
     
     File.open(path, "w") {|f| f.print(src2)}
 
     commit_info = ctx.commit(@wc_path)
     rev2 = commit_info.revision
 
- assert_equal(src1, ctx.cat(path, rev1))
- assert_equal(src2, ctx.cat(path, rev2))
- assert_equal(src2, ctx.cat(path))
+ assert_equal(normalized_src1, ctx.cat(path, rev1))
+ assert_equal(normalized_src2, ctx.cat(path, rev2))
+ assert_equal(normalized_src2, ctx.cat(path))
   end
 
   def test_lock
@@ -1552,8 +1556,10 @@
 
   def test_switch
     log = "sample log"
- trunk_src = normalize_line_break("trunk source\n")
- tag_src = normalize_line_break("tag source\n")
+ trunk_src = "trunk source\n"
+ tag_src = "tag source\n"
+ normalized_trunk_src = normalize_line_break(trunk_src)
+ normalized_tag_src = normalize_line_break(tag_src)
     file = "sample.txt"
     file = "sample.txt"
     trunk_dir = "trunk"
@@ -1581,10 +1587,10 @@
     tag_rev = ctx.commit(@wc_path).revision
 
     assert_equal(youngest_rev, ctx.switch(@wc_path, trunk_repos_uri))
- assert_equal(trunk_src, ctx.cat(path))
+ assert_equal(normalized_trunk_src, ctx.cat(path))
 
     assert_equal(youngest_rev, ctx.switch(@wc_path, tag_repos_uri))
- assert_equal(tag_src, ctx.cat(path))
+ assert_equal(normalized_tag_src, ctx.cat(path))
 
 
     notify_info = []
@@ -1593,7 +1599,7 @@
     end
     
     assert_equal(trunk_rev, ctx.switch(@wc_path, trunk_repos_uri, trunk_rev))
- assert_equal(trunk_src, ctx.cat(path))
+ assert_equal(normalized_trunk_src, ctx.cat(path))
     assert_equal([
                    [path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
                    [@wc_path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
@@ -1603,7 +1609,7 @@
 
     notify_info.clear
     assert_equal(tag_rev, ctx.switch(@wc_path, tag_repos_uri, tag_rev))
- assert_equal(tag_src, ctx.cat(path))
+ assert_equal(normalized_tag_src, ctx.cat(path))
     assert_equal([
                    [path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
                    [@wc_path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
@@ -1614,7 +1620,8 @@
 
   def test_authentication
     log = "sample log"
- src = normalize_line_break("source\n")
+ src = "source\n"
+ normalized_src = normalize_line_break(src)
     file = "sample.txt"
     path = File.join(@wc_path, file)
     svnserve_uri = "#{@repos_svnserve_uri}/#{file}"
@@ -1654,12 +1661,13 @@
       cred.password = @password
       cred.may_save = false
     end
- assert_equal(src, ctx.cat(svnserve_uri))
+ assert_equal(normalized_src, ctx.cat(svnserve_uri))
   end
 
   def test_simple_provider
     log = "sample log"
- src = normalize_line_break("source\n")
+ src = "source\n"
+ normalized_src = normalize_line_break(src)
     file = "sample.txt"
     path = File.join(@wc_path, file)
     svnserve_uri = "#{@repos_svnserve_uri}/#{file}"
@@ -1675,7 +1683,7 @@
     setup_auth_baton(ctx.auth_baton)
     ctx.add_simple_provider
     assert_raises(Svn::Error::RaNotAuthorized) do
- assert_equal(src, ctx.cat(svnserve_uri))
+ assert_equal(normalized_src, ctx.cat(svnserve_uri))
     end
 
     ctx = Svn::Client::Context.new
@@ -1686,19 +1694,20 @@
       cred.password = @password
       cred.may_save = true
     end
- assert_equal(src, ctx.cat(svnserve_uri))
+ assert_equal(normalized_src, ctx.cat(svnserve_uri))
 
     ctx = Svn::Client::Context.new
     setup_auth_baton(ctx.auth_baton)
     ctx.add_simple_provider
- assert_equal(src, ctx.cat(svnserve_uri))
+ assert_equal(normalized_src, ctx.cat(svnserve_uri))
   end
 
   def test_windows_simple_provider
     return unless Svn::Core.respond_to?(:add_windows_simple_provider)
 
     log = "sample log"
- src = normalize_line_break("source\n")
+ src = "source\n"
+ normalized_src = normalize_line_break(src)
     file = "sample.txt"
     path = File.join(@wc_path, file)
     svnserve_uri = "#{@repos_svnserve_uri}/#{file}"
@@ -1714,7 +1723,7 @@
     setup_auth_baton(ctx.auth_baton)
     ctx.add_windows_simple_provider
     assert_raises(Svn::Error::RaNotAuthorized) do
- assert_equal(src, ctx.cat(svnserve_uri))
+ ctx.cat(svnserve_uri)
     end
 
     ctx = Svn::Client::Context.new
@@ -1725,12 +1734,12 @@
       cred.password = @password
       cred.may_save = true
     end
- assert_equal(src, ctx.cat(svnserve_uri))
+ assert_equal(normalized_src, ctx.cat(svnserve_uri))
 
     ctx = Svn::Client::Context.new
     setup_auth_baton(ctx.auth_baton)
     ctx.add_windows_simple_provider
- assert_equal(src, ctx.cat(svnserve_uri))
+ assert_equal(normalized_src, ctx.cat(svnserve_uri))
   end
   
   def test_username_provider

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 1 13:06:30 2007

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