pure def is_even(n: Int) -> Bool {
return n % 2 == 0
}
test "4 is even" {
observe is_even(4) == True
}
Lesson 1 / tests/even_test.vary
The smallest test
Verify one fact about one function.
A test block holds one or more observe assertions. Each observe is a boolean expression that must be true at runtime; if it is not, the test fails and the runner exits non-zero.
vary test tests/even_test.vary
Expected output
Results: 1 passed, 0 failed