Skip to content

Commit

Permalink
Make tests pass
Browse files Browse the repository at this point in the history
* Remove all vestiges of "Plugin" hell
* Make LoaderTest hush up
* Make Commands.runCommandWithArgs a public API
* Fix RiddlParserInput.fromCwdPath
  • Loading branch information
reidspencer committed Aug 14, 2024
1 parent 85a5f8b commit 7c46f81
Show file tree
Hide file tree
Showing 14 changed files with 6 additions and 315 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package com.ossuminc.riddl.command

import com.ossuminc.riddl.language.Messages
import com.ossuminc.riddl.language.Messages.{Messages, errors}
import com.ossuminc.riddl.utils.Plugin
import pureconfig.{ConfigCursor, ConfigObjectCursor, ConfigReader}
import pureconfig.error.ConfigReaderFailures
import scopt.OParser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object Commands:
end match
end loadCommandNamed

private def runCommandWithArgs(
def runCommandWithArgs(
name: String,
args: Array[String],
log: Logger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class IncludeAndImportTest extends ParsingTest {
}
"handle inclusions into domain" in { (td: TestData) =>
val (root, rpi) = checkFile("Domain Includes", "includes/domainIncludes.riddl")
val url = URL("file", "", "", defaultInputDir + "/includes/domainIncluded.riddl")
val url = URL.fromCwdPath(defaultInputDir + "/includes/domainIncluded.riddl")
val inc = StringParserInput("", url)
root.domains mustNot be(empty)
root.domains.head.includes mustNot be(empty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ trait ParsingTest extends TestingBasisWithTestData {
): Either[Messages, Root] = {
parsePath(file.toPath, commonOptions)
}

def parse[T <: RiddlValue, U <: RiddlValue](
input: RiddlParserInput,
parser: P[?] => P[T],
Expand Down Expand Up @@ -187,7 +187,7 @@ trait ParsingTest extends TestingBasisWithTestData {
def checkFile(
@unused label: String,
fileName: String,
directory: String = defaultInputDir
directory: String = defaultInputDir
): (Root, RiddlParserInput) = {
val path = java.nio.file.Path.of(directory, fileName)
val rpi = fromCwdPath(path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ object RiddlParserInput {
*
*/
def fromCwdPath(path:Path, purpose: String =""): RiddlParserInput =
val url = URL.fromFullPath(path.toString)
val url = URL.fromCwdPath(path.toString)
val future = fromURL(url, purpose)
Await.result(future, 10.seconds)

Expand Down
117 changes: 0 additions & 117 deletions utils/jvm/src/main/scala/com/ossuminc/riddl/utils/Plugin.scala

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LoaderTest extends AnyWordSpec with Matchers {
)
val contentF = Loader(url).load
val content = Await.result(contentF, 5.seconds)
info(content)
// info(content)
}
}
}
26 changes: 0 additions & 26 deletions utils/jvm/src/test/scala/com/ossuminc/riddl/utils/PluginSpec.scala

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions utils/jvm/src/test/scala/com/ossuminc/riddl/utils/TestPlugin.scala

This file was deleted.

0 comments on commit 7c46f81

Please sign in to comment.