File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -219,10 +219,10 @@ object zip {
219219 class ZipSource private [os] (val src : os.Path , val dest : Option [os.SubPath ])
220220 object ZipSource {
221221 implicit def fromPath (src : os.Path ): ZipSource = new ZipSource (src, None )
222+ implicit def fromSeqPath (srcs : Seq [os.Path ]): Seq [ZipSource ] = srcs.map(fromPath)
222223 implicit def fromPathTuple (tuple : (os.Path , os.SubPath )): ZipSource =
223224 new ZipSource (tuple._1, Some (tuple._2))
224225 }
225-
226226}
227227
228228object unzip {
Original file line number Diff line number Diff line change @@ -176,6 +176,17 @@ object ZipOpTests extends TestSuite {
176176 assert(paths == expected)
177177 }
178178
179+ test(" zipList" ) - prep { wd =>
180+ val sources = wd / " folder1"
181+ val zipFilePath = os.zip(
182+ dest = wd / " my.zip" ,
183+ sources = os.list(sources)
184+ )
185+
186+ val expected = os.unzip.list(source = zipFilePath).map(_.resolveFrom(sources)).toSet
187+ assert(os.list(sources).toSet == expected)
188+ }
189+
179190 test(" unzipStream" ) - prep { wd =>
180191 // Step 1: Create an in-memory ZIP file as a stream
181192 val zipStreamOutput = new ByteArrayOutputStream ()
You can’t perform that action at this time.
0 commit comments