#adpro #exam #cheat #sheet
- Start by opening VSCode in the project folder
- Start Metals extension
- Add the main method in the bottom of Exam.scala
- Use F5 to press the run button over the @main method
- Look at the results in the Debug Console
Note: I tested a little example, where I’m still allowed to run the main even with non-compiling code in the file? Maybe this is intended, just be aware of this. 😧
Main method
@main def test: Unit =
println("Hello World")
Run tests
- Go to the test folder
- Press Command+Shift+, and then Command+F
Run directly in scala-cli
Run all tests
scala-cli test . -w
-w makes the scala-cli watch for any changes. Here, simply save the file to rerun the code.
Run all tests, but only output a specific one
scala-cli test . -w -- -f Ex01
Use a specific JVM version.