Philip Martin wrote:
> "D.J. Heap" <dj@shadyvale.net> writes:
>
>
>>I don't know why this is failing. Even stepping through the test with
>>a python debugger (Komodo) the expected and actual output look exactly
>>the same newlines and all. But the regex match fails. Tweaking \n to
>>.* doesn't help either. I'm only vaguely familiar with regex...do the
>>\'s cause escaping problems there?
>
>
> It would help if you included the failing test output, and a diff of
> your change, as it is I can only guess what's failing and how you are
> trying to fix it.
>
> Hmm, I see an earlier message from Ben had some output. Are you
> getting the exact same failure? Note that "refers to a directory"
> occurs twice within the test and only one of them is a regex, the
> other is a string.
>
Yes, same failure as the breakage list shows.
The backslashes in the path require escaping for the regex...this patch
works, but there's probably a better way to do it in python:
Index: subversion/tests/clients/cmdline/cat_tests.py
===================================================================
--- subversion/tests/clients/cmdline/cat_tests.py (revision 15168)
+++ subversion/tests/clients/cmdline/cat_tests.py (working copy)
@@ -84,6 +84,15 @@
None, svntest.SVNAnyOutput, 'cat',
bogus_path)
+def escape_backslashes(s):
+ s2 = ""
+ for c in s:
+ if c == '\\':
+ s2 += "\\\\"
+ else:
+ s2 += c
+ return s2
+
def cat_skip_uncattable(sbox):
"cat should skip uncattable resources"
sbox.build()
@@ -107,11 +116,13 @@
if item_to_cat == new_file_path:
expected_err = "svn: warning: '" + item_to_cat + "'" + \
" is not under version control or doesn't exist\n"
+ expected_err = escape_backslashes(expected_err)
svntest.actions.run_and_verify_svn(None, None, expected_err,
'cat', item_to_cat)
elif os.path.isdir(item_to_cat):
expected_err = "svn: warning: '" + item_to_cat + "'" + \
" refers to a directory\n"
+ expected_err = escape_backslashes(expected_err)
svntest.actions.run_and_verify_svn(None, None,
expected_err, 'cat', item_to_cat)
else:
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jun 25 21:06:19 2005