Skip to content

Commit

Permalink
Fix #262: Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
pathikrit committed May 4, 2020
1 parent cf61098 commit d825b23
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/better/files/File.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ class File private (val path: Path)(implicit val fileSystem: FileSystem = path.g
* @return The destination where contents are unzipped
*/
def unzipTo(
destination: File,
destination: File = File.newTemporaryDirectory(name.stripSuffix(".zip")),
zipFilter: ZipEntry => Boolean = _ => true
)(implicit
charset: Charset = DefaultCharset
Expand Down
Binary file added core/src/test/resources/better/files/issues-262.zip
Binary file not shown.
8 changes: 8 additions & 0 deletions core/src/test/scala/better/files/FileSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,14 @@ class FileSpec extends CommonSpec {
}
}

it should "handle backslashes in zip entry name" in {
val list = File("core/src/test/resources/better/files/issues-262.zip")
.unzipTo()
.listRecursively
.toList
assert(list.length === 3)
}

it should "ungzip" in {
val data = Seq("hello", "world")
for {
Expand Down

0 comments on commit d825b23

Please sign in to comment.