maanantai 19. kesäkuuta 2017 4.57.03 UTC+3 Brian T. Grant kirjoitti:
> I'm using test-driving my solutions using ScalaTest. If you're interested in exploring this option, I can provide some direction for getting the project set up with ScalaTest and running tests from SBT.
>
> On Tuesday, June 6, 2017 at 3:32:06 AM UTC-5,
teem...@gmail.com wrote:I'm doing the exercises in the book, and while some of them have built-in functions to test them, like testFib, some don't, like isSorted. I'd like to be able to just load my solution to a REPL and test them out with different numbers. Is there an easy way to do this with SBT? Right now I'm using 'console' and :load with the whole path, but this seems kind of clunky. Is there a way to have some exercises automatically in scope or something similar? Or is there an even better way to test your solutions?
Thanks, but I ended up finding a way (just a couple of days ago) to try things out a bit quicker: by writing ~console in sbt, when you save your code the console recompiles automatically. Also, it's possible to import the custom List class for example by import fpinscala.datastructures._. This was roughly what I was looking for.