Skip to content

Commit

Permalink
Add failing test for Files.walk order
Browse files Browse the repository at this point in the history
  • Loading branch information
SystemFw committed Dec 16, 2021
1 parent ed202fa commit 9592a1d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions io/shared/src/test/scala/fs2/io/file/FilesSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package file
import cats.effect.{IO, Resource}
import cats.kernel.Order
import cats.syntax.all._
import cats.kernel.instances.order._

import scala.concurrent.duration._

Expand Down Expand Up @@ -490,6 +491,17 @@ class FilesSuite extends Fs2Suite with BaseFileSuite {
.foldMonoid
.assertEquals(31) // the root + 5 children + 5 files per child directory
}

test("returns files in order of traversal") {
Stream
.resource(tempFilesHierarchy)
.flatMap(topDir => Files[IO].walk(topDir))
.compile
.toList
.map { paths =>
assertEquals(paths, paths.sorted)
}
}
}

test("writeRotate") {
Expand Down

0 comments on commit 9592a1d

Please sign in to comment.