Summary
In this chapter, we learned how to write tests in V. We saw the syntax and usage of the assert
keyword and learned how to write a simple test and run it. We then learned about the testsuite_begin
and testsuite_end
functions and learned how to use those functions in performing pre- and post-test activities, respectively. This chapter also covered the popular AAA pattern of writing tests. We also learned how to write tests for functions with optional return types.
In the latter parts of this chapter, we saw various approaches to writing and running tests that span from a simple program to a program with modules. We also learned different approaches to running tests contained in a single file, tests that belong to a module, and also, all tests contained in a project. Finally, we saw how to see the detailed output generated by the test runner using the stats
argument. Having learned how to write and run tests in V, you will now be able to write applications in V that are covered...