diff options
author | Miguelangel Jose Freitas Loreto <miguelangel.freitas@gmail.com> | 2009-07-04 21:02:41 -0330 |
---|---|---|
committer | Dmitry Bogatov <KAction@debian.org> | 2018-12-02 05:36:56 +0000 |
commit | d42e9428681c357ae0cd1923f5f336c12551812f (patch) | |
tree | cb6ddd8abd722cb8c9740dadf43bc55e22c5c743 /tests | |
parent | 31d17b652382f9c0903cf339b1722350b65f2081 (diff) | |
parent | 11470c63662bffe68b6b5fbfccdf5f34d208bcb6 (diff) |
Import Debian changes 6.5-1
dtrx (6.5-1) unstable; urgency=low
* New upstram release.
* Ready to build with python 2.6, thanks Alessio Treglia (Closes: #526996)
* debian/rules:
- -include /usr/share/python/python.mk.
- Append $(py_setup_install_args) to install arguments.
* debian/control:
- Standards-Version: 3.8.2
- B-D-I: Add rst2man to build upstream manpage.
* Remove debian/dtrx.1, using README file instead.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/compare.py | 23 | ||||
-rw-r--r-- | tests/test-2_all.deb | bin | 0 -> 590 bytes | |||
-rw-r--r-- | tests/tests.yml | 32 |
3 files changed, 45 insertions, 10 deletions
diff --git a/tests/compare.py b/tests/compare.py index cdbcc5d..7927467 100644 --- a/tests/compare.py +++ b/tests/compare.py @@ -1,7 +1,8 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- # # compare.py -- High-level tests for dtrx. -# Copyright (c) 2006, 2007, 2008 Brett Smith <brettcsmith@brettcsmith.org>. +# Copyright © 2006-2009 Brett Smith <brettcsmith@brettcsmith.org>. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -54,8 +55,13 @@ class ExtractorTest(object): setattr(self, 'options', kwargs.get('options', '-n').split()) setattr(self, 'filenames', kwargs.get('filenames', '').split()) for key in ('directory', 'prerun', 'posttest', 'baseline', 'error', - 'grep', 'antigrep', 'input', 'output', 'cleanup'): + 'input', 'output', 'cleanup'): setattr(self, key, kwargs.get(key, None)) + for key in ('grep', 'antigrep'): + value = kwargs.get(key, []) + if isinstance(value, str): + value = [value] + setattr(self, key, value) def get_results(self, commands, stdin=None): print >>output_buffer, "Output from %s:" % (' '.join(commands),) @@ -165,12 +171,13 @@ class ExtractorTest(object): return None def grep_output(self, output): - if self.grep and (not re.search(self.grep.replace(' ', '\\s+'), - output, re.MULTILINE)): - return "output did not match %s" % (self.grep) - elif self.antigrep and re.search(self.antigrep.replace(' ', '\\s+'), - output, re.MULTILINE): - return "output matched antigrep %s" % (self.antigrep) + for pattern in self.grep: + if not re.search(pattern.replace(' ', '\\s+'), output, + re.MULTILINE): + return "output did not match %s" % (pattern) + for pattern in self.antigrep: + if re.search(pattern.replace(' ', '\\s+'), output, re.MULTILINE): + return "output matched antigrep %s" % (self.antigrep) return None def check_output(self, output): diff --git a/tests/test-2_all.deb b/tests/test-2_all.deb Binary files differnew file mode 100644 index 0000000..2ed2886 --- /dev/null +++ b/tests/test-2_all.deb diff --git a/tests/tests.yml b/tests/tests.yml index 54e79cd..a0758f0 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -29,6 +29,13 @@ cd test-1.23 ar p ../$1 data.tar.gz | tar -zx +- name: .deb with LZMA compression + filenames: test-2_all.deb + baseline: | + mkdir test-2 + cd test-2 + ar p ../$1 data.tar.lzma | lzcat | tar -x + - name: basic .gem filenames: test-1.23.gem baseline: | @@ -339,6 +346,12 @@ cd test-onefile tar -zxf ../$1 +- name: prompt wording with one file + options: "" + filenames: test-onefile.tar.gz + input: i + grep: file _I_nside + - name: one file extracted with rename, with Expected text options: "" filenames: test-onefile.tar.gz @@ -358,7 +371,7 @@ - name: bomb with preceding dot in the table filenames: test-dot-first-bomb.tar.gz options: "" - antigrep: one entry + antigrep: one baseline: | mkdir test-dot-first-bomb cd test-dot-first-bomb @@ -512,6 +525,22 @@ grep: "^1/2/3$" antigrep: "^dtrx:" +- name: listing multiple file with misleading extensions + options: -l + filenames: trickery.tar.gz trickery.tar.gz + prerun: cp ${1}test-1.23.zip ${1}trickery.tar.gz + cleanup: rm -f ${1}trickery.tar.gz + output: | + trickery.tar.gz: + 1/2/3 + a/b + foobar + + trickery.tar.gz: + 1/2/3 + a/b + foobar + - name: non-archive error filenames: /dev/null error: true @@ -606,7 +635,6 @@ directory: busydir filenames: ../test-onedir.tar.gz output: | - ../test-onedir.tar.gz: test/ test/foobar test/quux |