Skip to content

Commit 1a5de7f

Browse files
committed
fixed reading files
1 parent 2ceeba2 commit 1a5de7f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

analysis/src/test/scala/org/polystat/odin/analysis/MutualrecTests.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,19 @@ class MutualrecTests extends CatsEffectSuite with ScalaCheckEffectSuite {
9696
"""Method "f" was called from the object "derived", although it is not defined there!"""
9797
)
9898

99-
runTestsFrom[IO]("/mutualrec/with_recursion") { (fileName, code) =>
99+
runTestsFrom[IO]("mutualrec/with_recursion") { (fileName, code) =>
100100
for {
101101
expectedErrors <- parseCallChains[IO](fileNameToChain(fileName))
102102
actualErrors <- odinErrors[IO](code)
103103
_ <- actualErrors.traverse_(e => IO.println(e.show))
104104
} yield assertEquals(actualErrors.toSet, expectedErrors.toSet)
105105
}.unsafeRunSync()
106106

107-
runTestsFrom[IO]("/mutualrec/no_recursion") { (_, code) =>
107+
runTestsFrom[IO]("mutualrec/no_recursion") { (_, code) =>
108108
odinErrors[IO](code).map(errors => assert(errors.isEmpty))
109109
}.unsafeRunSync()
110110

111-
runTestsFrom[IO]("/mutualrec/failing") { (fileName, code) =>
111+
runTestsFrom[IO]("mutualrec/failing") { (fileName, code) =>
112112
interceptIO[Exception](odinErrors[IO](code))
113113
.map(error => assertEquals(error.getMessage, expectedError(fileName)))
114114
}.unsafeRunSync()

parser/src/test/scala/org/polystat/odin/parser/eo/ParserTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ object ParserTests {
305305

306306
val examplesFromSources: IO[List[TestCase[EOProg[EOExprOnly]]]] =
307307
files
308-
.readEoCodeFromDirectory[IO]("/eo_sources")
308+
.readEoCodeFromDirectory[IO]("eo_sources")
309309
.map(
310310
_.map { case (name, code) =>
311311
TestCase(label = name, code = code)

utils/src/main/scala/org/polystat/odin/utils/files.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ package org.polystat.odin.utils
22

33
import cats.effect.Sync
44
import fs2.io.file.Path
5-
import fs2.io.readClassResource
5+
import fs2.io.readClassLoaderResource
66
import fs2.text
77

88
object files {
99

1010
def readEoCodeFromDirectory[F[_]: Sync](
1111
dir: String
1212
): F[List[(String, String)]] = {
13-
readClassResource(dir)
13+
readClassLoaderResource(dir)
1414
.through(text.utf8.decode)
1515
.through(text.lines)
1616
.filter(_.nonEmpty)
1717
.flatMap(path =>
18-
readClassResource(
18+
readClassLoaderResource(
1919
(Path(dir) / Path(path))
2020
.toString
2121
.replace("\\", "/")

0 commit comments

Comments
 (0)