Testing out JmonkeyEngine to make a game in Scala with Akka Actors within a pure FP layer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

3 years ago
  1. package wow.doge.mygame
  2. import org.scalatest.funsuite.AnyFunSuite
  3. import monix.bio.Task
  4. import scala.concurrent.duration._
  5. import monix.execution.Scheduler.Implicits.global
  6. import wow.doge.mygame.subsystems.scriptsystem.ScriptCompiler
  7. import io.odin.consoleLogger
  8. import wow.doge.mygame.implicits._
  9. class MonixScriptCompilerTest extends AnyFunSuite {
  10. test("some-test") {
  11. ScriptCompiler(consoleLogger[Task]())
  12. .use(scriptCompiler =>
  13. for {
  14. // _ <-
  15. // scriptCompiler.source
  16. // .doOnNextF(el => Task(println(s"Got $el")))
  17. // .completedL
  18. // .toIO
  19. // .hideErrors
  20. // .startAndForget
  21. response <- scriptCompiler.request(
  22. ScriptCompiler.Get(
  23. os.pwd / "assets" / "scripts" / "scala" / "hello2.sc",
  24. _,
  25. false
  26. )
  27. )(20.seconds)
  28. _ <- Task(pprint.log(response.toString))
  29. // _ <- Task.sleep(4.seconds)
  30. // _ <- scriptCompiler.tell(
  31. // ScriptCompiler.CompileAny(
  32. // os.pwd / "assets" / "scripts" / "scala" / "hello2.sc"
  33. // )
  34. // )
  35. // _ <- Task.sleep(4.seconds)
  36. // _ <- Task.sleep(8.seconds)
  37. } yield ()
  38. )
  39. .runSyncUnsafe(20.seconds)
  40. }
  41. }