One of my favorite techniques in Rust / IntelliJ is writing a code fragment of the form:
#[test]
fn blahblahblah() {
...
}
then IntelliJ will give me a green triangle in the lhs gutter, which if I click, it will run the function as a Unit test. (If no assert fails, it passes; if any assert fails, it’s an error).
I’m wondering if there is something similar in VSCode / OCaml.
The main requirements I want are:
-
the code for the unit test is embedded in the same *.ml file as the source code
-
VSCode gives me a green arrow or sorts on the side, which when I click, it runs this one particular test
The goal here is to have a workflow of: write a func, write a test, … and have everything all in one file and easy to run a particular test