Author: julianfoad
Date: Tue Jun 28 10:51:38 2011
New Revision: 1140518

URL: http://svn.apache.org/viewvc?rev=1140518&view=rev
Log:
Correct some peg-revision-parsing documentation and update the tests to
include all the documented examples.

* subversion/include/svn_opt.h
  (svn_opt_parse_path): Correct the documented result in three of the
    examples.

* subversion/tests/libsvn_subr/opt-test.c
  (test_parse_peg_rev): Add the remaining five documented examples as test
    cases, including two of the three that were wrongly documented. Also, in
    the cases where an error is expected, write '-1' instead of
    'svn_opt_revision_unspecified' in the 'expected revision' column to show
    more clearly that this column is not relevant.

Modified:
    subversion/trunk/subversion/include/svn_opt.h
    subversion/trunk/subversion/tests/libsvn_subr/opt-test.c

Modified: subversion/trunk/subversion/include/svn_opt.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_opt.h?rev=1140518&r1=1140517&r2=1140518&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_opt.h (original)
+++ subversion/trunk/subversion/include/svn_opt.h Tue Jun 28 10:51:38 2011
@@ -616,7 +616,7 @@ svn_opt_parse_all_args(apr_array_header_
                        apr_pool_t *pool);
 
 /**
- * Parse a working-copy or URL in @a path, extracting any trailing
+ * Parse a working-copy path or URL in @a path, extracting any trailing
  * revision specifier of the form "@rev" from the last component of
  * the path.
  *
@@ -632,14 +632,14 @@ svn_opt_parse_all_args(apr_array_header_
  *   - "http://a/b@%7B1999-12-31%7D";  -> "http://a/b";,    (date, 1999-12-31)
  *   - "foo/bar@1:2"                  -> error
  *   - "foo/bar@baz"                  -> error
- *   - "foo/bar@"                     -> "foo/bar",       (base)
- *   - "foo/@bar@"                    -> "foo/@bar",      (base)
+ *   - "foo/bar@"                     -> "foo/bar",       (unspecified)
+ *   - "foo/@bar@"                    -> "foo/@bar",      (unspecified)
  *   - "foo/bar/@13"                  -> "foo/bar/",      (number, 13)
  *   - "foo/bar@@13"                  -> "foo/bar@",      (number, 13)
  *   - "foo/@bar@HEAD"                -> "foo/@bar",      (head)
  *   - "foo@/bar"                     -> "foo@/bar",      (unspecified)
  *   - "foo@HEAD/bar"                 -> "foo@HEAD/bar",  (unspecified)
- *   - "@foo/bar"                     -> error
+ *   - "@foo/bar"                     -> "@foo/bar",      (unspecified)
  *   - "@foo/bar@"                    -> "@foo/bar",      (unspecified)
  *
  *   [*] Syntactically valid but probably not semantically useful.

Modified: subversion/trunk/subversion/tests/libsvn_subr/opt-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/opt-test.c?rev=1140518&r1=1140517&r2=1140518&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/opt-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/opt-test.c Tue Jun 28 
10:51:38 2011
@@ -44,14 +44,19 @@ test_parse_peg_rev(apr_pool_t *pool)
     { "foo/bar@{1999-12-31}", "foo/bar",      {svn_opt_revision_date, {0}} },
     { "http://a/b@27";,        "http://a/b";,   {svn_opt_revision_number, {27}} 
},
     { "http://a/b@COMMITTED";, "http://a/b";,   {svn_opt_revision_committed} },
-    { "foo/bar@1:2",          NULL,           {svn_opt_revision_unspecified} },
-    { "foo/bar@baz",          NULL,           {svn_opt_revision_unspecified} },
+    { "http://a/b@{1999-12-31}";,    "http://a/b",{svn_opt_revision_date, {0}} 
},
+    { "http://a/b@%7B1999-12-31%7D","http://a/b",{svn_opt_revision_date, {0}} 
},
+    { "foo/bar@1:2",          NULL,           {-1} },
+    { "foo/bar@baz",          NULL,           {-1} },
     { "foo/bar@",             "foo/bar",      {svn_opt_revision_unspecified} },
+    { "foo/@bar@",            "foo/@bar",     {svn_opt_revision_unspecified} },
     { "foo/bar/@13",          "foo/bar/",     {svn_opt_revision_number, {13}} 
},
     { "foo/bar@@13",          "foo/bar@",     {svn_opt_revision_number, {13}} 
},
     { "foo/@bar@HEAD",        "foo/@bar",     {svn_opt_revision_head} },
     { "foo@/bar",             "foo@/bar",     {svn_opt_revision_unspecified} },
     { "foo@HEAD/bar",         "foo@HEAD/bar", {svn_opt_revision_unspecified} },
+    { "@foo/bar",             "@foo/bar",     {svn_opt_revision_unspecified} },
+    { "@foo/bar@",            "@foo/bar",     {svn_opt_revision_unspecified} },
   };
 
   for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++)


Reply via email to