Skip to content

Commit

Permalink
Added unit test based on pr#180
Browse files Browse the repository at this point in the history
Closes #180
  • Loading branch information
cedmail authored and slachiewicz committed Dec 31, 2022
1 parent 9b6b399 commit 3c1bfc4
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,21 @@ public void shouldNotWarnAboutDifferentCasingForDirectoryEntries( @TempDir File
assertTrue( this.abstractUnArchiver.shouldExtractEntry( temporaryFolder, file, entryname, entryDate ) );
assertEquals( 0, this.abstractUnArchiver.casingMessageEmitted.get() );
}

@Test
public void shouldExtractWhenCasingDifferOnlyInEntryNamePath( @TempDir File temporaryFolder)
throws IOException
{
// given
String entryName = "directory/whatever.txt";
File file = new File( temporaryFolder, entryName ); // does not create the file!
file.mkdirs();
file.createNewFile();
Date entryDate = new Date(System.currentTimeMillis() + 5000);

// when & then
abstractUnArchiver.setOverwrite( true );
assertTrue( abstractUnArchiver.shouldExtractEntry( temporaryFolder, file, entryName, entryDate ) );
assertEquals(0, abstractUnArchiver.casingMessageEmitted.get());
}
}

0 comments on commit 3c1bfc4

Please sign in to comment.