In message <3E6D279B.4060604@xbc.nu>
Branko Cibej <brane@xbc.nu> wrote:
> As you see, I already committed your patch. Could you update and then
> post a new patch for just the tests? Thanks!
* subversion/tests/clients/cmdline/prop_tests.py
(strip_or_add_whitespace): More tests for whitespace stripping and forcing
svn:executable.
Index: subversion/tests/clients/cmdline/prop_tests.py
===================================================================
--- subversion/tests/clients/cmdline/prop_tests.py (revision 5279)
+++ subversion/tests/clients/cmdline/prop_tests.py (working copy)
@@ -749,7 +749,10 @@
wc_dir = sbox.wc_dir
A_path = os.path.join(wc_dir, 'A')
+ B_path = os.path.join(wc_dir, 'A', 'B')
iota_path = os.path.join(wc_dir, 'iota')
+ lambda_path = os.path.join(wc_dir, 'A', 'B', 'lambda')
+ mu_path = os.path.join(wc_dir, 'A', 'mu')
# We'll use a file to set the prop values, so that weird characters
# in the props don't confuse the shell.
@@ -765,20 +768,35 @@
# Leading and trailing whitespace should be stripped
set_prop('svn:mime-type', ' text/html\n\n', iota_path)
+ set_prop('svn:mime-type', 'text/html', mu_path)
# Leading and trailing whitespace should be stripped
set_prop('svn:eol-style', '\nnative\n', iota_path)
+ set_prop('svn:eol-style', 'native', mu_path)
# A trailing newline should be added
set_prop('svn:ignore', '*.o\nfoo.c', A_path)
+ set_prop('svn:ignore', '*.o\nfoo.c\n', B_path)
# A trailing newline should be added
set_prop('svn:externals', 'foo http://foo.com/repos', A_path)
+ set_prop('svn:externals', 'foo http://foo.com/repos\n', B_path)
# Leading and trailing whitespace should be stripped, but not internal
# whitespace
set_prop('svn:keywords', ' Rev Date \n', iota_path)
+ set_prop('svn:keywords', 'Rev Date', mu_path)
+ # svn:executable value should be forced to a '*'
+ set_prop('svn:executable', 'foo', iota_path)
+ set_prop('svn:executable', '', lambda_path)
+ set_prop('svn:executable', ' ', mu_path)
+
+ # Anything else should be untouched
+ set_prop('svn:foo', 'bar', lambda_path)
+ set_prop('svn:foo', ' bar baz', mu_path)
+ set_prop('svn:foo', 'bar\n', iota_path)
+
# Close and remove the prop value file
propval_file.close()
os.unlink(propval_path)
@@ -792,6 +810,14 @@
print "Actual standard output: ", out, "\n"
return 1
+ out, err = svntest.main.run_svn(None, 'pg', 'svn:mime-type', mu_path)
+ exp_out = ['text/html\n']
+ if out != exp_out:
+ print "svn pg svn:mime-type output does not match expected."
+ print "Expected standard output: ", exp_out, "\n"
+ print "Actual standard output: ", out, "\n"
+ return 1
+
# Check svn:eol-style
out, err = svntest.main.run_svn(None, 'pg', 'svn:eol-style', iota_path)
exp_out = ['native\n']
@@ -801,6 +827,14 @@
print "Actual standard output: ", out, "\n"
return 1
+ out, err = svntest.main.run_svn(None, 'pg', 'svn:eol-style', mu_path)
+ exp_out = ['native\n']
+ if out != exp_out:
+ print "svn pg svn:eol-style output does not match expected."
+ print "Expected standard output: ", exp_out, "\n"
+ print "Actual standard output: ", out, "\n"
+ return 1
+
# Check svn:ignore
# FIXME: Temporarily disabled on Windows due to \r\n vs. \n issues
if not svntest.main.windows:
@@ -812,6 +846,14 @@
print "Actual standard output: ", out, "\n"
return 1
+ out, err = svntest.main.run_svn(None, 'pg', 'svn:ignore', B_path)
+ exp_out = ['*.o\n', 'foo.c\n', '\n']
+ if out != exp_out:
+ print "svn pg svn:ignore output does not match expected."
+ print "Expected standard output: ", exp_out, "\n"
+ print "Actual standard output: ", out, "\n"
+ return 1
+
# Check svn:externals
# FIXME: Temporarily disabled on Windows due to \r\n vs. \n issues
if not svntest.main.windows:
@@ -823,6 +865,14 @@
print "Actual standard output: ", out, "\n"
return 1
+ out, err = svntest.main.run_svn(None, 'pg', 'svn:externals', B_path)
+ exp_out = ['foo http://foo.com/repos\n', '\n']
+ if out != exp_out:
+ print "svn pg svn:externals output does not match expected."
+ print "Expected standard output: ", exp_out, "\n"
+ print "Actual standard output: ", out, "\n"
+ return 1
+
# Check svn:keywords
out, err = svntest.main.run_svn(None, 'pg', 'svn:keywords', iota_path)
exp_out = ['Rev Date\n']
@@ -832,6 +882,68 @@
print "Actual standard output: ", out, "\n"
return 1
+ out, err = svntest.main.run_svn(None, 'pg', 'svn:keywords', mu_path)
+ exp_out = ['Rev Date\n']
+ if out != exp_out:
+ print "svn pg svn:keywords output does not match expected."
+ print "Expected standard output: ", exp_out, "\n"
+ print "Actual standard output: ", out, "\n"
+ return 1
+
+
+ # Check svn:executable
+ out, err = svntest.main.run_svn(None, 'pg', 'svn:executable', iota_path)
+ exp_out = ['*\n']
+ if out != exp_out:
+ print "svn pg svn:keywords output does not match expected."
+ print "Expected standard output: ", exp_out, "\n"
+ print "Actual standard output: ", out, "\n"
+ return 1
+
+ out, err = svntest.main.run_svn(None, 'pg', 'svn:executable', lambda_path)
+ exp_out = ['*\n']
+ if out != exp_out:
+ print "svn pg svn:keywords output does not match expected."
+ print "Expected standard output: ", exp_out, "\n"
+ print "Actual standard output: ", out, "\n"
+ return 1
+
+ out, err = svntest.main.run_svn(None, 'pg', 'svn:executable', mu_path)
+ exp_out = ['*\n']
+ if out != exp_out:
+ print "svn pg svn:keywords output does not match expected."
+ print "Expected standard output: ", exp_out, "\n"
+ print "Actual standard output: ", out, "\n"
+ return 1
+
+ # Check other props
+ out, err = svntest.main.run_svn(None, 'pg', 'svn:foo', lambda_path)
+ exp_out = ['bar\n']
+ if out != exp_out:
+ print "svn pg svn:keywords output does not match expected."
+ print "Expected standard output: ", exp_out, "\n"
+ print "Actual standard output: ", out, "\n"
+ return 1
+
+ out, err = svntest.main.run_svn(None, 'pg', 'svn:foo', mu_path)
+ exp_out = [' bar baz\n']
+ if out != exp_out:
+ print "svn pg svn:keywords output does not match expected."
+ print "Expected standard output: ", exp_out, "\n"
+ print "Actual standard output: ", out, "\n"
+ return 1
+
+ # FIXME: Temporarily disabled on Windows due to \r\n vs. \n issues
+ if not svntest.main.windows:
+ out, err = svntest.main.run_svn(None, 'pg', 'svn:foo', iota_path)
+ exp_out = ['bar\n', '\n']
+ if out != exp_out:
+ print "svn pg svn:keywords output does not match expected."
+ print "Expected standard output: ", exp_out, "\n"
+ print "Actual standard output: ", out, "\n"
+ return 1
+
+
return 0
--
Alex Waugh alex@alexwaugh.com
RISC OS Software from http://www.alexwaugh.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 11 23:01:33 2003