Author: brane
Date: Wed Feb 25 11:16:52 2015
New Revision: 1662199

URL: http://svn.apache.org/r1662199
Log:
On the svn-info-detail branch: Add tests.

* BRANCH-README: Final branch status update; TODO list is empty.

* subversion/tests/cmdline/info_tests.py
  (info_item_simple,
   info_item_simple_multiple,
   info_item_url,
   info_item_uncommmitted,
   info_item_failures): New test cases.
  (test_list): Updated.

Modified:
    subversion/branches/svn-info-detail/BRANCH-README
    subversion/branches/svn-info-detail/subversion/tests/cmdline/info_tests.py

Modified: subversion/branches/svn-info-detail/BRANCH-README
URL: 
http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/BRANCH-README?rev=1662199&r1=1662198&r2=1662199&view=diff
==============================================================================
--- subversion/branches/svn-info-detail/BRANCH-README (original)
+++ subversion/branches/svn-info-detail/BRANCH-README Wed Feb 25 11:16:52 2015
@@ -38,14 +38,13 @@ as described in option 1. of issue #4556
 Branch Status
 =============
 
-TODO:
-  - Add tests for 'svn info --show-item'.
-  - Resolve FIXME near 'case info_item_wc_root' in info-cmd.c:850.
+TODO: none
 
 DONE:
   - Removed 'svn youngest' (already merged to trunk before 1.9.x branch).
   - Implemented 'svn info --show-item [--no-newline]' with output suitable
     for single targets.
-  - Modify --show-item output with multiple targets and/or recursive
+  - Modified --show-item output with multiple targets and/or recursive
     mode to display both the requested item and the (relative) path
     and/or URL it applies to.
+  - Added tests for 'svn info --show-item'.

Modified: 
subversion/branches/svn-info-detail/subversion/tests/cmdline/info_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/cmdline/info_tests.py?rev=1662199&r1=1662198&r2=1662199&view=diff
==============================================================================
--- subversion/branches/svn-info-detail/subversion/tests/cmdline/info_tests.py 
(original)
+++ subversion/branches/svn-info-detail/subversion/tests/cmdline/info_tests.py 
Wed Feb 25 11:16:52 2015
@@ -636,6 +636,102 @@ def node_hidden_info(sbox):
                                       sbox.ospath('E/beta'))
 
 
+def info_item_simple(sbox):
+  "show one info item"
+
+  sbox.build(read_only=True)
+  svntest.actions.run_and_verify_svn(
+    '1', [],
+    'info', '--show-item=revision',
+    '--no-newline', sbox.ospath(''))
+
+
+def info_item_simple_multiple(sbox):
+  "show one info item with multiple targets"
+
+  sbox.build(read_only=True)
+
+  svntest.actions.run_and_verify_svn(
+    r'^jrandom\s+\S+/info_tests-\d+(/[^/]+)?$', [],
+    'info', '--show-item=last-changed-author',
+    '--depth=immediates', sbox.ospath(''))
+
+  svntest.actions.run_and_verify_svn(
+    r'^1\s+\S+/info_tests-\d+/[^/]+$', [],
+    'info', '--show-item=last-changed-rev',
+    sbox.ospath('A'), sbox.ospath('iota'))
+
+
+def info_item_url(sbox):
+  "show one info item with URL targets"
+
+  sbox.build(create_wc=False, read_only=True)
+
+  svntest.actions.run_and_verify_svn(
+    '1', [],
+    'info', '--show-item=last-changed-rev',
+    sbox.repo_url)
+
+
+  svntest.actions.run_and_verify_svn(
+    r'^1\s+[^/:]+://.+/repos/[^/]+$', [],
+    'info', '--show-item=last-changed-rev',
+    sbox.repo_url + '/A', sbox.repo_url + '/iota')
+
+
+  # Empty working copy root on URL targets
+  svntest.actions.run_and_verify_svn(
+    '', [],
+    'info', '--show-item=wc-root',
+    sbox.repo_url)
+
+
+def info_item_uncommmitted(sbox):
+  "show one info item on uncommitted targets"
+
+  sbox.build()
+
+  svntest.main.file_write(sbox.ospath('newfile'), 'newfile')
+  sbox.simple_add('newfile')
+  sbox.simple_mkdir('newdir')
+
+  svntest.actions.run_and_verify_svn(
+    '', [],
+    'info', '--show-item=last-changed-rev',
+    sbox.ospath('newfile'))
+
+  svntest.actions.run_and_verify_svn(
+    '', [],
+    'info', '--show-item=last-changed-author',
+    sbox.ospath('newdir'))
+
+  svntest.actions.run_and_verify_svn(
+    r'\s+\S+/new(file|dir)', [],
+    'info', '--show-item=last-changed-date',
+    sbox.ospath('newfile'), sbox.ospath('newdir'))
+
+  svntest.actions.run_and_verify_svn(
+    r'\^/new(file|dir)\s+\S+/new(file|dir)', [],
+    'info', '--show-item=relative-url',
+    sbox.ospath('newfile'), sbox.ospath('newdir'))
+
+
+def info_item_failures(sbox):
+  "failure modes of 'svn info --show-item'"
+
+  sbox.build(read_only=True)
+
+  svntest.actions.run_and_verify_svn(
+    None, r".*E205000: .*('svn help info'|; did you mean 'wc-root'\?).*",
+    'info', '--show-item=root',
+    sbox.ospath(''))
+
+  svntest.actions.run_and_verify_svn(
+    None, r'.*(W155010|E200009):.*',
+    'info', '--show-item=revision',
+    sbox.ospath('not-there'))
+
+
 ########################################################################
 # Run the tests
 
@@ -652,6 +748,11 @@ test_list = [ None,
               binary_tree_conflict,
               relpath_escaping,
               node_hidden_info,
+              info_item_simple,
+              info_item_simple_multiple,
+              info_item_url,
+              info_item_uncommmitted,
+              info_item_failures,
              ]
 
 if __name__ == '__main__':


Reply via email to