#adpro #exam #cheat #sheet

  1. Start by opening VSCode in the project folder
  2. Start Metals extension
  3. Add the main method in the bottom of Exam.scala
  4. Use F5 to press the run button over the @main method
  5. 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

  1. Go to the test folder
  2. 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.