Skip to content

Commit 3c1bfc4

Browse files
cedmailslachiewicz
authored andcommitted
Added unit test based on pr#180
Closes #180
1 parent 9b6b399 commit 3c1bfc4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/test/java/org/codehaus/plexus/archiver/AbstractUnArchiverTest.java

+17
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,21 @@ public void shouldNotWarnAboutDifferentCasingForDirectoryEntries( @TempDir File
182182
assertTrue( this.abstractUnArchiver.shouldExtractEntry( temporaryFolder, file, entryname, entryDate ) );
183183
assertEquals( 0, this.abstractUnArchiver.casingMessageEmitted.get() );
184184
}
185+
186+
@Test
187+
public void shouldExtractWhenCasingDifferOnlyInEntryNamePath( @TempDir File temporaryFolder)
188+
throws IOException
189+
{
190+
// given
191+
String entryName = "directory/whatever.txt";
192+
File file = new File( temporaryFolder, entryName ); // does not create the file!
193+
file.mkdirs();
194+
file.createNewFile();
195+
Date entryDate = new Date(System.currentTimeMillis() + 5000);
196+
197+
// when & then
198+
abstractUnArchiver.setOverwrite( true );
199+
assertTrue( abstractUnArchiver.shouldExtractEntry( temporaryFolder, file, entryName, entryDate ) );
200+
assertEquals(0, abstractUnArchiver.casingMessageEmitted.get());
201+
}
185202
}

0 commit comments

Comments
 (0)