[svn] Some more tests to make sure we always do the right thing in the trunk

Fri, 23 Nov 2007 15:22:34 -0500

author
brett
date
Fri, 23 Nov 2007 15:22:34 -0500
branch
trunk
changeset 38
f637b9d24c21
parent 37
c27c1073ec12
child 39
027fcd7ae002

[svn] Some more tests to make sure we always do the right thing in the
archive-with-one-file case. Also be a little more thorough in our cleanup.

tests/compare.py file | annotate | diff | comparison | revisions
tests/tests.yml file | annotate | diff | comparison | revisions
--- a/tests/compare.py	Fri Nov 23 11:59:27 2007 -0500
+++ b/tests/compare.py	Fri Nov 23 15:22:34 2007 -0500
@@ -117,9 +117,11 @@
             extra_options = ['!', '-name', TESTSCRIPT_NAME]
         else:
             target = ROOT_DIR
-            extra_options = ['-type', 'd',
+            extra_options = ['(', '(', '-type', 'd',
                              '!', '-name', 'CVS',
-                             '!', '-name', '.svn']
+                             '!', '-name', '.svn', ')',
+                             '-or', '-name', 'test-text',
+                             '-or', '-name', 'test-onefile', ')']
         status = subprocess.call(['find', target,
                                   '-mindepth', '1', '-maxdepth', '1'] +
                                  extra_options +
--- a/tests/tests.yml	Fri Nov 23 11:59:27 2007 -0500
+++ b/tests/tests.yml	Fri Nov 23 15:22:34 2007 -0500
@@ -287,6 +287,37 @@
   baseline: |
     tar -zxf $1
 
+- name: default behavior with one file
+  options: -n
+  filenames: test-onefile.tar.gz
+  baseline: |
+    mkdir test-onefile
+    cd test-onefile
+    tar -zxf ../$1
+
+- name: one file extracted inside a directory
+  options: ""
+  filenames: test-onefile.tar.gz
+  input: i
+  baseline: |
+    mkdir test-onefile
+    cd test-onefile
+    tar -zxf ../$1
+
+- name: one file extracted with rename
+  options: ""
+  filenames: test-onefile.tar.gz
+  input: r
+  baseline: |
+    tar -zxOf $1 >test-onefile
+
+- name: one file extracted here
+  options: ""
+  filenames: test-onefile.tar.gz
+  input: h
+  baseline: |
+    tar -zxf $1
+
 - name: bomb with preceding dot in the table
   filenames: test-dot-first-bomb.tar.gz
   options: ""
@@ -394,13 +425,3 @@
   filenames: /dev/null
   error: true
   grep: ERROR
-
-- name: extract an archive with one file here
-  filenames: test-onefile.tar.gz
-  options: ""
-  grep: "one entry: "
-  input: |
-    h
-    n
-  baseline: |
-    tar -zxf $1

mercurial