aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-06-24 22:55:13 +0000
committerRob Landley <rob@landley.net>2006-06-24 22:55:13 +0000
commit641c3537c0bf63793a6195108a1d2e682ed4cba1 (patch)
tree22cf82890d9cbd90e1bc54038afe2b320caf5c14
parente1ee4826843e82ffd1d5f9f4cfb0f77ac6c8420e (diff)
downloadbusybox-w32-641c3537c0bf63793a6195108a1d2e682ed4cba1.tar.gz
busybox-w32-641c3537c0bf63793a6195108a1d2e682ed4cba1.tar.bz2
busybox-w32-641c3537c0bf63793a6195108a1d2e682ed4cba1.zip
Add a test from Glenn.
-rwxr-xr-xtestsuite/unzip.tests38
1 files changed, 38 insertions, 0 deletions
diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests
new file mode 100755
index 000000000..77814886f
--- /dev/null
+++ b/testsuite/unzip.tests
@@ -0,0 +1,38 @@
1#!/bin/sh
2
3# Tests for unzip.
4# Copyright 2006 Rob Landley <rob@landley.net>
5# Copyright 2006 Glenn McGrath <bug1@ihug.co.nz>
6# Licensed under GPL v2, see file LICENSE for details.
7
8. testing.sh
9
10# testing "test name" "options" "expected result" "file input" "stdin"
11# file input will be file called "input"
12# test can create a file "actual" instead of writing to stdout
13
14# Create a scratch directory
15
16mkdir temp
17cd temp
18
19# Create test file to work with.
20
21mkdir foo
22touch foo/bar
23zip foo.zip foo foo/bar > /dev/null
24rm -f foo/bar
25rmdir foo
26
27# Test that unzipping just foo doesn't create bar.
28testing "unzip (subdir only)" "unzip -q foo.zip foo/ && test -d foo && test ! -f foo/bar && echo yes" "yes\n" "" ""
29
30rmdir foo
31rm foo.zip
32
33# Clean up scratch directory.
34
35cd ..
36rm -rf temp
37
38exit $FAILCOUNT