-
Book Overview & Buying
-
Table Of Contents
Getting Started with V Programming
By :
Writing tests in V is straightforward. In this section, we will explore three simple concepts that will get you started with writing tests in V. They are as follows:
assert keyword to compare the actual and expected outcome._test.v extension.test_.In the next subsection, we will learn the syntax of the assert keyword and its usage in V.
In V, you can use the assert keyword to compare the outcome of a function you are writing tests for with the expected outcome. Following is the syntax that shows how to use the assert keyword in V followed by a Boolean expression:
assert boolean_expression
In the preceding syntax, we can see that the assert keyword is followed by an expression whose output must always evaluate to a Boolean result. If the Boolean result is true then the assertion succeeds, otherwise...