Browse Source

tests for PR 38973

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@398164 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 19 years ago
parent
commit
5d443a11d9
2 changed files with 41 additions and 1 deletions
  1. +22
    -0
      src/etc/testcases/taskdefs/unzip.xml
  2. +19
    -1
      src/testcases/org/apache/tools/ant/taskdefs/UnzipTest.java

+ 22
- 0
src/etc/testcases/taskdefs/unzip.xml View File

@@ -70,6 +70,28 @@
</unzip>
</target>

<target name="testTwoPatternSets" depends="prepareTestZip">
<unzip dest="unziptestout" src="unziptest.zip">
<patternset>
<include name="2/**"/>
</patternset>
<patternset>
<include name="3/**"/>
</patternset>
</unzip>
</target>

<target name="testTwoPatternSetsWithExcludes" depends="prepareTestZip">
<unzip dest="unziptestout" src="unziptest.zip">
<patternset>
<include name="2/**"/>
</patternset>
<patternset>
<exclude name="2/**"/>
</patternset>
</unzip>
</target>

<target name="selfExtractingArchive">
<mkdir dir="unziptestout"/>
<unzip dest="unziptestout" src="zip/test.exe"/>


+ 19
- 1
src/testcases/org/apache/tools/ant/taskdefs/UnzipTest.java View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2005 The Apache Software Foundation
* Copyright 2000-2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -104,6 +104,24 @@ public class UnzipTest extends BuildFileTest {
assertFileMissing("2/bar is excluded", "unziptestout/2/bar");
}

/*
* PR 38973
*/
public void testTwoPatternSets() {
executeTarget("testTwoPatternSets");
assertFileMissing("1/foo is not included", "unziptestout/1/foo");
assertFileExists("2/bar is included", "unziptestout/2/bar");
}

/*
* PR 38973
*/
public void testTwoPatternSetsWithExcludes() {
executeTarget("testTwoPatternSetsWithExcludes");
assertFileMissing("1/foo is not included", "unziptestout/1/foo");
assertFileMissing("2/bar is excluded", "unziptestout/2/bar");
}

/*
* PR 16213
*/


Loading…
Cancel
Save