Test method in the VisionScript standard library provides a method for testing your code. The standard library contains methods that you can use in your code but must be imported before use.
To test a program, first import the
To write a test, use the
In the following script, we test that the number of cats in a provided image is greater than 3:
Detect["./cats.jpg"] Count Test[Count > 3]
Tests are counted in two global values:
PassedTests: The number of tests that have passed.
FailedTests: The number of tests that have failed.
To read the number of passed and failed tests, use the
Say["Passed tests:"] Say[PassedTests] Say["Failed tests:"] Say[FailedTests]