45 lines
1.3 KiB
Scala
45 lines
1.3 KiB
Scala
package wow.doge.mygame
|
|
|
|
import scala.concurrent.duration._
|
|
|
|
import io.odin.consoleLogger
|
|
import monix.bio.Task
|
|
import monix.execution.Scheduler.Implicits.global
|
|
import org.scalatest.funsuite.AnyFunSuite
|
|
import wow.doge.mygame.subsystems.scriptsystem.ScriptCompiler
|
|
|
|
class MonixScriptCompilerTest extends AnyFunSuite {
|
|
|
|
test("some-test") {
|
|
ScriptCompiler(consoleLogger[Task]())
|
|
.use(scriptCompiler =>
|
|
for {
|
|
// _ <-
|
|
// scriptCompiler.source
|
|
// .doOnNextF(el => Task(println(show"Got $el")))
|
|
// .completedL
|
|
// .toIO
|
|
// .hideErrors
|
|
// .startAndForget
|
|
response <- scriptCompiler.request(
|
|
ScriptCompiler.GetScript(
|
|
os.pwd / "assets" / "scripts" / "scala" / "hello2.sc",
|
|
_,
|
|
false
|
|
)
|
|
)(20.seconds)
|
|
_ <- Task(pprint.log(response.toString))
|
|
// _ <- Task.sleep(4.seconds)
|
|
// _ <- scriptCompiler.tell(
|
|
// ScriptCompiler.CompileAny(
|
|
// os.pwd / "assets" / "scripts" / "scala" / "hello2.sc"
|
|
// )
|
|
// )
|
|
// _ <- Task.sleep(4.seconds)
|
|
// _ <- Task.sleep(8.seconds)
|
|
} yield ()
|
|
)
|
|
.runSyncUnsafe(20.seconds)
|
|
}
|
|
}
|