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

[PATCH] normalize line endings for expected results of test_client.rb Ruby Bindings tests

From: Joe Swatosh <joe.swatosh_at_gmail.com>
Date: 2007-01-17 18:27:32 CET

Hi,
If I run each test in the TestCase individually, with this patch I am down to

==========================
D:\SVN\src-trunk\subversion\bindings\swig\ruby>ruby -Itest
test\test_client.rb -n test_blame
Loaded suite test/test_client
Started
E
Finished in 5.984 seconds.

  1) Error:
test_blame(SvnClientTest):
Svn::Error: D:\SVN\src-trunk\subversion\libsvn_subr\io.c:1801 Can't
remove 'test\repos\db\revs\1'
Can't set file 'test\repos\db\revs\1' read-write: Access is denied.
    ./svn/util.rb:68:in `svn_repos_delete'
    ./svn/util.rb:68:in `delete'
    ./test/util.rb:105:in `teardown_repository'
    ./test/util.rb:44:in `teardown_basic'
    test/test_client.rb:15:in `teardown'

1 tests, 2 assertions, 0 failures, 1 errors

D:\SVN\src-trunk\subversion\bindings\swig\ruby>ruby -Itest
test\test_client.rb -n test_diff
Loaded suite test/test_client
Started
E
Finished in 5.944 seconds.

  1) Error:
test_diff(SvnClientTest):
Svn::Error: D:\SVN\src-trunk\subversion\libsvn_subr\io.c:1801 Can't
remove 'test\repos\db\revs\2'
Can't set file 'test\repos\db\revs\2' read-write: Access is denied.
    ./svn/util.rb:68:in `svn_repos_delete'
    ./svn/util.rb:68:in `delete'
    ./test/util.rb:105:in `teardown_repository'
    ./test/util.rb:44:in `teardown_basic'
    test/test_client.rb:15:in `teardown'

1 tests, 2 assertions, 0 failures, 1 errors

D:\SVN\src-trunk\subversion\bindings\swig\ruby>ruby -Itest
test\test_client.rb -n test_diff_peg
Loaded suite test/test_client
Started
E
Finished in 5.883 seconds.

  1) Error:
test_diff_peg(SvnClientTest):
Svn::Error: D:\SVN\src-trunk\subversion\libsvn_subr\io.c:1801 Can't
remove 'test\repos\db\revs\2'
Can't set file 'test\repos\db\revs\2' read-write: Access is denied.
    ./svn/util.rb:68:in `svn_repos_delete'
    ./svn/util.rb:68:in `delete'
    ./test/util.rb:105:in `teardown_repository'
    ./test/util.rb:44:in `teardown_basic'
    test/test_client.rb:15:in `teardown'

1 tests, 2 assertions, 0 failures, 1 errors
============================

If I try to run the tests together I get many more errors due to
previous tests leaving the test repository lieing around. This is
looking like it might be releated to the Fs close issue we've been
talking about.

--
Joe Swatosh
[[[
* subversion/bindings/swig/ruby/test/test_client.rb
  call normalize_line_break on the expected result for various tests.
]]]
Index: subversion/bindings/swig/ruby/test/test_client.rb
===================================================================
--- subversion/bindings/swig/ruby/test/test_client.rb   (revision 23063)
+++ subversion/bindings/swig/ruby/test/test_client.rb   (working copy)
@@ -848,7 +848,7 @@
     ctx.merge(branch, rev1, branch, rev2, trunk)
     rev3 = ctx.commit(@wc_path).revision
-    assert_equal(src, ctx.cat(trunk_path, rev3))
+    assert_equal(normalize_line_break(src), ctx.cat(trunk_path, rev3))
     ctx.rm(branch_path)
     rev4 = ctx.commit(@wc_path).revision
@@ -895,7 +895,7 @@
     ctx.merge_peg(branch, rev1, rev2, trunk)
     rev3 = ctx.commit(@wc_path).revision
-    assert_equal(src, ctx.cat(trunk_path, rev3))
+    assert_equal(normalize_line_break(src), ctx.cat(trunk_path, rev3))
     ctx.rm(branch_path)
     rev4 = ctx.commit(@wc_path).revision
@@ -1286,17 +1286,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(normalize_line_break(src1), ctx.cat(path, rev1))
+    assert_equal(normalize_line_break(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(normalize_line_break(src1), ctx.cat(path, rev1))
+    assert_equal(normalize_line_break(src2), ctx.cat(path, rev2))
+    assert_equal(normalize_line_break(src2), ctx.cat(path))
   end
   def test_lock
@@ -1582,10 +1582,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(normalize_line_break(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(normalize_line_break(tag_src), ctx.cat(path))
     notify_info = []
@@ -1594,7 +1594,7 @@
     end
     assert_equal(trunk_rev, ctx.switch(@wc_path, trunk_repos_uri, trunk_rev))
-    assert_equal(trunk_src, ctx.cat(path))
+    assert_equal(normalize_line_break(trunk_src), ctx.cat(path))
     assert_equal([
                    [path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
                    [@wc_path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
@@ -1604,7 +1604,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(normalize_line_break(tag_src), ctx.cat(path))
     assert_equal([
                    [path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
                    [@wc_path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
@@ -1655,7 +1655,7 @@
       cred.password = @password
       cred.may_save = false
     end
-    assert_equal(src, ctx.cat(svnserve_uri))
+    assert_equal(normalize_line_break(src), ctx.cat(svnserve_uri))
   end
   def test_simple_provider
@@ -1687,12 +1687,12 @@
       cred.password = @password
       cred.may_save = true
     end
-    assert_equal(src, ctx.cat(svnserve_uri))
+    assert_equal(normalize_line_break(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(normalize_line_break(src), ctx.cat(svnserve_uri))
   end
   def test_windows_simple_provider
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jan 17 18:27:42 2007

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.