Testing Your Code

The 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 Test module:


To write a test, use the Test[] method.

In the following script, we test that the number of cats in a provided image is greater than 3:

Test[Count[] > 3]

Tests are counted in two global values:

To read the number of passed and failed tests, use the PassedTests and FailedTests methods:

Say["Passed tests:"]

Say["Failed tests:"]

Made with ❤️ by capjamesg