From 74afb288ccf0221dd426de083883f9452dea3634 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 16 May 2019 19:59:06 +0100 Subject: [PATCH] [localfilestream] Compare test files within a Set (#11) Fixes #10 * [localfilestream] Compare test files within a Set Removes issue of files being read in different orders. * [localfilestream] add missing parameter type --- .../scala/net/kemitix/s3thorp/LocalFileStreamSuite.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/scala/net/kemitix/s3thorp/LocalFileStreamSuite.scala b/src/test/scala/net/kemitix/s3thorp/LocalFileStreamSuite.scala index d1aa7e2..4f59dcf 100644 --- a/src/test/scala/net/kemitix/s3thorp/LocalFileStreamSuite.scala +++ b/src/test/scala/net/kemitix/s3thorp/LocalFileStreamSuite.scala @@ -1,5 +1,7 @@ package net.kemitix.s3thorp +import java.io.File + import org.scalatest.FunSpec class LocalFileStreamSuite extends FunSpec with LocalFileStream { @@ -7,9 +9,9 @@ class LocalFileStreamSuite extends FunSpec with LocalFileStream { describe("streamDirectoryPaths") { var uploadResource = Resource(this, "upload") it("should find all files") { - val result: List[String] = streamDirectoryPaths(uploadResource).toList - .map(x=>uploadResource.toPath.relativize(x.toPath).toString) - assertResult(List("subdir/leaf-file", "root-file"))(result) + val result: Set[String] = streamDirectoryPaths(uploadResource).toSet + .map { x: File => uploadResource.toPath.relativize(x.toPath).toString } + assertResult(Set("subdir/leaf-file", "root-file"))(result) } } }